View source: R/Meteorological_drought.R
spatial_spei | R Documentation |
Wrapper function from the SCI and SPEI packages to calculate the spatially-distributed Standardized Precipitation-Evapotranspiration Index (SPEI)
spatial_spei(
P_data,
PE_data,
scale,
ref_start = NULL,
ref_end = NULL,
distribution = "log-Logistic",
fit = "ub-pwm",
na.rm = TRUE,
package = "SCI",
...
)
P_data |
'SpatRaster' object that contains spatially-distributed monthly precipitation data that will be used to calculate the SPEI. This 'SpatRaster' must include the time that corresponds to the dates of the respective layers. They can be set with the function time of the terra package. |
PE_data |
'SpatRaster' object that contains spatially-distributed monthly potential evaporation (also referred to as potential evapotranspiation) data that will be used to calculate the SPEI. This 'SpatRaster' must include the time that corresponds to the dates of the respective layers. They can be set with the function time of the terra package. |
scale |
Integer value that represents the time scale at which the SPI will be computed. |
ref_start |
Optional value that represents the starting point of the reference period used for computing the index. The date should be introduced as '%Y-%m'. For example: "1989-02". The default is NULL, which indicates that the first layer in the 'SpatRaster' will be used as starting point. |
ref_end |
Optional value that represents the ending point of the reference period used for computing the index. The date should be introduced as '%Y-%m'. For example: "1989-02". The default is NULL, which indicates that the last layer in the 'SpatRaster' will be used as ending point. |
distribution |
Optional value indicating the name of the distribution function to be used for computing the SPEI (one of 'log-Logistic', 'Gamma' and 'PearsonIII'). Defaults to 'log-Logistic' for SPEI. |
fit |
Optional value indicating the name of the method used for computing the distribution function parameters (one of 'ub-pwm', 'pp-pwm' and 'max-lik'). Defaults to 'ub-pwm'. |
na.rm |
Should the NA values be removed? Set to TRUE. |
package |
Either 'SCI' or 'SPEI'. Should the SCI or SPEI package be used in the implementation? |
... |
Additional variables that can be used for the 'spi' function of the SPEI package. |
Spatially-distributed SPEI values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.