Calculate (sc)PDSI in R