Description Usage Arguments Details Author(s) Examples
Given a dataframe with longitude and latitude coordinates, extracts rainfall and temperature data from Worldclim. Rasters are downloaded if not provided.
1 2 3 4 5 | get_climate_vars(data, vars = NULL, output = c("monthly", "annual"))
aggregate_clim(cl, funs = c("mean", "quantile"), probs = c(0.05, 0.95))
annualize_clim(cl)
|
data |
Dataframe with columns |
vars |
Vector of climate variables to be extracted; see Details. |
output |
Either 'monthly' (default), or 'annual', in which case the |
cl |
Output of |
funs |
For |
probs |
For |
The climate variables are any of the Worldclim 2.0 variables, including "tmin","tmax","tavg","prec","srad","wind","vapr". Also allowed is 'pet', which will be extracted from the Zomer PET database (see get_zomer_pet
).
Remko Duursma
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# First set the path to where WorldClim layers will be downloaded,
# and if extracting PET, where you downloaded the Zomer PET database
# see ?get_zomer_pet
options(worldclimpath="/path/to/worldclim")
res <- get_climate_vars(data=data.frame(longitude=150, latitude=-33), vars=c("tmin","bio"))
# To extract PET, first set the path to where the layers were downloaded
options(zomerpetpath="c:/data/zomer")
res <- get_climate_vars(data=data.frame(longitude=150, latitude=-33), vars=c("pet","tavg"))
# By default all monthly values are returned, use annualize to get annual
# averages (or total in case of MAP):
annualize_clim(res)
# ... or simply use output="annual"
res <- get_climate_vars(data=data.frame(longitude=150, latitude=-33),
vars=c("pet","tavg"), output="annual")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.