This function automates downloading and importing CRU CL v. 2.0 climatology data and creates a data.table of the data. If requested, minimum and maximum temperature may also be automatically calculated as described in the data readme.txt file. Data may be cached for later use by this function, saving time downloading files in future use of this function.
get_CRU_df(
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,
cache = FALSE
)get_cru_df(
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,
cache = FALSE
)
A data.table::data.table object of CRU
CL v. 2.0 climatology elements.
Fetches precipitation (millimetres/month) from server and
returns it in the data frame, TRUE
. Defaults to FALSE
.
Fetch cv of precipitation (percent) from server and
returns it in the data frame, TRUE
. Defaults to FALSE
. NOTE Setting
this to TRUE
will always results in pre being set to TRUE
and
returned as well.
Fetches wet-days (number days with >0.1 millimetres rain
per month) and returns it in the data frame? Defaults to FALSE
.
Fetches temperature (degrees Celsius) and returns it in the
data frame, TRUE
. Defaults to FALSE
.
Fetches mean diurnal temperature range (degrees Celsius)
and returns it in the data frame? Defaults to FALSE
.
Fetches relative humidity and returns it in the data frame,
TRUE
. Defaults to FALSE.
Calculates minimum temperature values (degrees Celsius)
and returns it in the data frame, TRUE
. Defaults to FALSE
.
Calculates maximum temperature (degrees Celsius) and
returns it in the data frame, TRUE
. Defaults to FALSE
.
Fetch sunshine, percent of maximum possible (percent of
day length) and return it in the data frame? Defaults to FALSE
.
Fetches ground-frost records (number of days with ground-
frost per month) and return it in the data frame? Defaults to FALSE
.
Fetches 10m wind speed (metres/second) and returns it in the
data frame, TRUE
. Defaults to FALSE
.
Fetches elevation (converted to metres) and returns it in
the data frame, TRUE
. Defaults to FALSE
.
Stores CRU CL v. 2.0 data files locally for later use.
If FALSE
, the downloaded files are removed when the R session is closed.
To take advantage of cached files in future sessions, use cache = TRUE
even after the initial download and caching. Defaults to FALSE
.
precipitation (millimetres/month)
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 windspeed (metres/second)
elevation (automatically converted to metres)
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, adamhsparks@gmail.com
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_CRU_stack, manage_cache.
if (FALSE) { # interactive()
# Download data and create a data frame of precipitation and temperature
# without caching the data files
CRU_pre_tmp <- get_CRU_df(pre = TRUE, tmp = TRUE)
head(CRU_pre_tmp)
CRU_pre_tmp
}
Run the code above in your browser using DataLab