X=runif(120, min = 0, max = 100) # 10-year monthly data
fit<-SDI(X,ts=3) # Compute the 3 month drought index
fit$SDI # Get the empirical drought index
z=matrix(t(fit$SDI),ncol=1)
plot(z, type="l", col=1, lwd=2, lty=1, xlim=c(0,120),xlab="Time",ylab="SDI")
Run the code above in your browser using DataLab