Description Usage Arguments Details Value
View source: R/precipitation.R
Crop rainfall, convert to daily and resample to desired extent and resolution
1 | cropresamplerain(file, r, Trace = TRUE)
|
file |
the name of the .nc file which the data are to be read from.
If it does not contain an absolute path, the file name is relative to the
current working directory, |
r |
an object of type raster of elevations. The returned |
Trace |
optional logical indicating whether to create and plot a raster of every 100th entry to enable progress to be tracked. |
This function crops and resamples the rainfall data in file
to the extent of
r
. It also performs elevation adjustments by applying a thin-plate spline model with
elevation as a covariate to calculate the expected total rainfall and number of zero
rainfall days. The resampled data is then adjusted accordingly. The 3600 values for each
grid cell location are then spline interpolated to give daily values. Currently, the
UKCP18 nc files contain errors in both the times and the defined coordinate reference
system. These are corrected in the function, but users are advised to check their data.
An object of class spatialarray
containing the following components:
A three-dimensional array of daily rainfall values
An object of class POSIXlt
of times arraydata
An object of class crs
indicating the coordinate reference system associated with arraydata
An object of class extent
indicating the geographic extent covered by arraydata
Units of arraydata
Description of arraydata
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.