1

I want to calculate Standardized Precipitation Index (SPI) of monthly rainfall raster in R. I have seen one question related to this in SO (R Standardized Precipitation Index .nc file), but it was not having any answers. So, I am putting a new question. I have downloaded the monthly rainfall data from the following source https://crudata.uea.ac.uk/cru/data/hrg/cru_ts_4.03/cruts.1905011326.v4.03/pre/

I have read it in R using raster package.

library(raster)
file <- "cru_ts4.03.1901.2018.pre.dat.nc"
rain <- brick(file)

I know it can be done using calc function of raster package and for SPI calculation many packages are available in R (e.g. spi, SPEI, precintcon). I am able to calculate SPI for point data. But I am unable to use the calc function for SPI calculation of raster data. Now my question is how to calculate SPI on this raster at different time scales (1, 2, 3, 6, 12, 24)?

UseR10085
  • 7,120
  • 3
  • 24
  • 54

0 Answers0