get_CRU_df: Download and create a data.table of CRU CL v. 2.0 climatology...

View source: R/get_CRU_df.R

get_CRU_dfR Documentation

Download and create a data.table of CRU CL v. 2.0 climatology elements

Description

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.

Usage

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
)

Arguments

pre

Fetches precipitation (millimetres/month) from server and returns it in the data frame, TRUE. Defaults to FALSE.

pre_cv

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.

rd0

Fetches wet-days (number days with >0.1 millimetres rain per month) and returns it in the data frame? Defaults to FALSE.

tmp

Fetches temperature (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

dtr

Fetches mean diurnal temperature range (degrees Celsius) and returns it in the data frame? Defaults to FALSE.

reh

Fetches relative humidity and returns it in the data frame, TRUE. Defaults to FALSE.

tmn

Calculates minimum temperature values (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

tmx

Calculates maximum temperature (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

sunp

Fetch sunshine, percent of maximum possible (percent of day length) and return it in the data frame? Defaults to FALSE.

frs

Fetches ground-frost records (number of days with ground- frost per month) and return it in the data frame? Defaults to FALSE.

wnd

Fetches 10m wind speed (metres/second) and returns it in the data frame, TRUE. Defaults to FALSE.

elv

Fetches elevation (converted to metres) and returns it in the data frame, TRUE. Defaults to FALSE.

cache

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.

Value

A data.table::data.table object of CRU CL v. 2.0 climatology elements.

Nomenclature and Units

pre

precipitation (millimetres/month)

cv

cv of precipitation (percent)

rd0

wet-days (number days with >0.1 millimetres rain per month)

tmp

mean temperature (degrees Celsius)

dtr

mean diurnal temperature range (degrees Celsius)

reh

relative humidity (percent)

sunp

sunshine (percent of maximum possible (percent of day length))

frs

ground-frost (number of days with ground-frost per month)

wnd

10 metre windspeed (metres/second)

elv

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

Author(s)

Adam H. Sparks, adamhsparks@gmail.com

Source

pre

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_pre.dat.gz

rd0

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_rd0.dat.gz

tmp

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz

dtr

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_dtr.dat.gz

reh

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_reh.dat.gz

sunp

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_sunp.dat.gz

frs

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_frs.dat.gz

wnd

https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_wnd.dat.gz, areas originally including Antarctica are removed.

elv

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.

References

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

See Also

create_CRU_stack, manage_cache.

Examples


# 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


adamhsparks/getCRUCL2.0 documentation built on Dec. 21, 2024, 4:32 a.m.