| Title: | 'CRU' 'CL' v. 2.0 Climatology Client |
|---|---|
| Description: | Provides functions that automate downloading and importing University of East Anglia Climate Research Unit ('CRU') 'CL' v. 2.0 climatology data, facilitates the calculation of minimum temperature and maximum temperature and formats the data into a data.table object or a 'terra' 'SpatRaster' object. 'CRU' 'CL' v. 2.0 data are a gridded climatology of 1961-1990 monthly means released in 2002 and cover all land areas (excluding Antarctica) at 10 arc minutes (0.1666667 degree) resolution. For more information see the description of the data provided by the University of East Anglia Climate Research Unit, <https://crudata.uea.ac.uk/cru/data/hrg/tmc/readme.txt>. |
| Authors: | Adam H. Sparks [aut, cre] (ORCID: <https://orcid.org/0000-0002-0061-8359>) |
| Maintainer: | Adam H. Sparks <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.0 |
| Built: | 2026-05-17 06:24:18 UTC |
| Source: | https://github.com/ropensci/getCRUCLdata |
Add derived temperature values for TMAX and TMIN
.add_derived_dt(dt, vars).add_derived_dt(dt, vars)
dt |
A data.table object of CRU data containing |
vars |
A named logical vector. |
A data.table with tmin and or tmax cols.
If tmin or tmax are requested but tmp or dtr are not requested, this
function drops the unrequested vars.
.drop_source_vars_dt(dt, vars).drop_source_vars_dt(dt, vars)
dt |
A data.table object of CRU data containing |
vars |
A named logical vector. |
A data.table with the unrequested var columns removed.
Automates importing CRU CL v.2.0 climatology data and from either the CRU server or local files and creates a data.table of the data. If requested, minimum and maximum temperature may also be calculated as described in the data readme.txt file and returned.
read_cru_dt( pre = FALSE, pre_cv = FALSE, rd0 = FALSE, tmp = FALSE, dtr = FALSE, reh = FALSE, tmn = FALSE, tmx = FALSE, sunp = FALSE, frs = FALSE, wnd = FALSE, elv = FALSE, x = NULL )read_cru_dt( pre = FALSE, pre_cv = FALSE, rd0 = FALSE, tmp = FALSE, dtr = FALSE, reh = FALSE, tmn = FALSE, tmx = FALSE, sunp = FALSE, frs = FALSE, wnd = FALSE, elv = FALSE, x = NULL )
pre |
Read precipitation (millimetres/month) and return it, |
pre_cv |
Read cv of precipitation (percent) and return it, |
rd0 |
Read wet-days (number days with >0.1 millimetres rain per
month) and return it, |
tmp |
Reads temperature (degrees Celsius) and return it, TRUE |
dtr |
Read mean diurnal temperature range (degrees Celsius)
and return it, |
reh |
Read relative humidity and return it, |
tmn |
Calculate minimum temperature values (degrees Celsius)
and return it, |
tmx |
Calculate maximum temperature (degrees Celsius) and return it,
|
sunp |
Read sunshine, percent of maximum possible (percent of
day length) and return it, |
frs |
Read ground-frost records (number of days with ground-
frost per month) and return it, |
wnd |
Read 10 m wind speed (metres/second) and return it, |
elv |
Read elevation (converted to metres) and return it, |
x |
An optional local file path where CRU CL v.2.0 .dat.gz files are located. If this is empty, the requested data will automatically be downloaded from the server. |
A data.table::data.table object of CRU CL v. 2.0 climatology elements.
precipitation (millimetres/month)
cv of precipitation (percent)
wet-days (number days with >0.1 millimetres rain per month)
mean temperature (degrees Celsius)
mean diurnal temperature range (degrees Celsius)
relative humidity (percent)
sunshine (percent of maximum possible (percent of day length))
ground-frost (number of days with ground-frost per month)
10 metre wind speed (metres/second)
elevation (automatically converted to metres from kilometres)
For more information see the description of the data provided by CRU, https://crudata.uea.ac.uk/cru/data/hrg/tmc/readme.txt
Adam H. Sparks, [email protected]
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_pre.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_rd0.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_dtr.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_reh.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_sunp.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_frs.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_wnd.dat.gz, areas originally including Antarctica are removed.
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_elv.dat.gz, values are converted from kilometres to metres.
This package crops all spatial outputs to an extent of ymin = -60, ymax = 85, xmin = -180, xmax = 180.
New, Mark, et al. "A high-resolution data set of surface climate over global land areas." Climate research 21.1 (2002): 1-25. https://crudata.uea.ac.uk/cru/data/hrg/tmc/new_et_al_10minute_climate_CR.pdf
# Create a data frame of temperature from locally available files in the # tempdir() directory. library(fs) f <- path(path_temp(), "grid_10min_tmp.dat.gz") download.file( url = "https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz", destfile = f ) cru_tmp <- read_cru_dt(tmp = TRUE, x = f) cru_tmp # or downloading directly from the CRU server cru_tmp <- read_cru_dt(tmp = TRUE) cru_tmp# Create a data frame of temperature from locally available files in the # tempdir() directory. library(fs) f <- path(path_temp(), "grid_10min_tmp.dat.gz") download.file( url = "https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz", destfile = f ) cru_tmp <- read_cru_dt(tmp = TRUE, x = f) cru_tmp # or downloading directly from the CRU server cru_tmp <- read_cru_dt(tmp = TRUE) cru_tmp
Create a terra::SpatRaster object or list of objects from CRU CL 2.0 data.
read_cru_rast( pre = FALSE, pre_cv = FALSE, rd0 = FALSE, tmp = FALSE, dtr = FALSE, reh = FALSE, tmn = FALSE, tmx = FALSE, sunp = FALSE, frs = FALSE, wnd = FALSE, elv = FALSE, x = NULL )read_cru_rast( pre = FALSE, pre_cv = FALSE, rd0 = FALSE, tmp = FALSE, dtr = FALSE, reh = FALSE, tmn = FALSE, tmx = FALSE, sunp = FALSE, frs = FALSE, wnd = FALSE, elv = FALSE, x = NULL )
pre |
Read precipitation (millimetres/month) and return it, |
pre_cv |
Read cv of precipitation (percent) and return it, |
rd0 |
Read wet-days (number days with >0.1 millimetres rain per
month) and return it, |
tmp |
Reads temperature (degrees Celsius) and return it, TRUE |
dtr |
Read mean diurnal temperature range (degrees Celsius)
and return it, |
reh |
Read relative humidity and return it, |
tmn |
Calculate minimum temperature values (degrees Celsius)
and return it, |
tmx |
Calculate maximum temperature (degrees Celsius) and return it,
|
sunp |
Read sunshine, percent of maximum possible (percent of
day length) and return it, |
frs |
Read ground-frost records (number of days with ground-
frost per month) and return it, |
wnd |
Read 10 m wind speed (metres/second) and return it, |
elv |
Read elevation (converted to metres) and return it, |
x |
An optional local file path where CRU CL v.2.0 .dat.gz files are located. If this is empty, the requested data will automatically be downloaded from the server. |
A terra::SpatRaster object.
precipitation (millimetres/month)
cv of precipitation (percent)
wet-days (number days with >0.1 millimetres rain per month)
mean temperature (degrees Celsius)
mean diurnal temperature range (degrees Celsius)
relative humidity (percent)
sunshine (percent of maximum possible (percent of day length))
ground-frost (number of days with ground-frost per month)
10 metre wind speed (metres/second)
elevation (automatically converted to metres from kilometres)
For more information see the description of the data provided by CRU, https://crudata.uea.ac.uk/cru/data/hrg/tmc/readme.txt
Adam H. Sparks, [email protected]
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_pre.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_rd0.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_dtr.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_reh.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_sunp.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_frs.dat.gz
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_wnd.dat.gz, areas originally including Antarctica are removed.
https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_elv.dat.gz, values are converted from kilometres to metres.
This package crops all spatial outputs to an extent of ymin = -60, ymax = 85, xmin = -180, xmax = 180.
New, Mark, et al. "A high-resolution data set of surface climate over global land areas." Climate research 21.1 (2002): 1-25. https://crudata.uea.ac.uk/cru/data/hrg/tmc/new_et_al_10minute_climate_CR.pdf
# Create a data frame of temperature from locally available files in the # tempdir() directory. library(fs) f <- path(path_temp(), "grid_10min_tmp.dat.gz") download.file( url = "https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz", destfile = f ) cru_tmp <- read_cru_rast(tmp = TRUE, x = f) cru_tmp # or downloading directly from the CRU server cru_tmp <- read_cru_rast(tmp = TRUE) cru_tmp# Create a data frame of temperature from locally available files in the # tempdir() directory. library(fs) f <- path(path_temp(), "grid_10min_tmp.dat.gz") download.file( url = "https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz", destfile = f ) cru_tmp <- read_cru_rast(tmp = TRUE, x = f) cru_tmp # or downloading directly from the CRU server cru_tmp <- read_cru_rast(tmp = TRUE) cru_tmp