You can install the released version of SPIspatial from Github with:
devtools::install_github("SPIspatial")
This package contains three functions that should be used in consecutive order:
Can be used to load a netCDF file and prints its metadata to the console.
It builds a raster brick from the loaded netCDF. The dimensions of the brick (x,y,z) must be read by the user from the metadata printed by load_ncdf. It populates each cell in the brick with the data contained in the netCDF, usually precipitation data.
It calculates the SPI for each timestep in every cell. When the input brick has 100 layers (z-dimension), the resulting SPI raster brick will also consist of about 100 layers (sometimes diverging due to parametrization).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.