Rnnmm: Annual count of days when PRCP ≥ nn mm

View source: R/Climdex.R

RnnmmR Documentation

Annual count of days when PRCP ≥ nn mm

Description

Annual count of days when PRCP ≥ nn mm

Usage

Rnnmm(rst_path, vct = NULL, start_date, end_date, init_month = NULL, thres)

Arguments

rst_path

File path to either:

  • 'GTiff files': Daily raster files that include the date in the file names (e.g., 'ProductX_1989-02-28.tif'). The dates must have the format '%Y-%m-%d'.

  • 'NCDF files': Monthly raster files that contain the daily layers respective for that month. The file name must include the date (e.g., 'ProductX_1989-02.nc'). The dates must have the format '%Y-%m'.

vct

Vector file of the study area (Optional). It will be used to crop the spatial extent of the raster files if required. This parameter is set to 'NULL'.

start_date

Position where the dates of the raster files start. For example, start_date = 10 for 'ProductX_1989-02-28.tif' as the date start in the 10th character.

end_date

Position where the dates of the raster files end. For example, end_date = 19 for 'ProductX_1989-02-28.tif', and end_date = 16 for 'ProductX_1989-02.nc'.

init_month

Numeric value that represents the initial month that will be used in the calculation of the indices for each year (1 = Jan, 2 = Feb, ...., 12 = December). This parameter is set to NULL meaning that if not specified, the year will start in January.

thres

Threshold value that corresponds to nn.

Value

raster layers with the spatial distribution of the annual count of days when PRCP ≥ nn mm (where nn is a user selected threshold) for each year of analysis.


obaezvil/SpatIndex documentation built on Aug. 9, 2024, 3:42 p.m.