Question about calculating spi.

Greetings to all. I am a new user in R and i would like some help. I have a .nc file containing precipatation data for which i want to calculate the spi index. At first i load the nc file to R studio with the following code
fn <- "D:\data\net\"
nc <- nc_open(fn)
dat <-ncvar_get(nc,attributes(nc$var)$names[1])
dat at this point the app starts to freeze for some reason maybe beacause the nc file is really big ~800mb
After i break the operation in the console it unfreazes. then i load spi package write this line and get this error.
spi(as.daily(fn,na.value = NA), period = 3, distribution = " Gamma")
Error in spei(data, scale, kernel, distribution, fit, na.rm, ref.start, :
argument "scale" is missing, with no default
I am probably doing something wrong here and i would really appriciate some help, any help lol. Thank you all in advance for your time