getEnv | R Documentation |
Get environmental variables from trusted, global datasets, and optionally extract it for point locations
getEnv(
region = NULL,
locs = NULL,
x = "x",
y = "y",
dem = NULL,
proj = NULL,
z_fix = NULL,
zoom = 10,
z_min = 0,
filt = 0,
slope = FALSE,
twi = FALSE,
depth = FALSE,
soils = NULL,
climate = NULL,
acc = 15,
vars = NULL,
overwrite = FALSE,
dir = tempdir(),
...
)
region |
A SpatRaster, Raster*, SpatVector, Spatial* or character
string representing the area of interest. Required unless |
locs |
(Optional) A data.frame or something coercible to a data.table containing all observations to which data should be extracted. |
x |
A character string representing the data column containing the 'x' coordinates in meters or degrees. Ignored if data is of class SpatVector or Spatial. |
y |
A character string representing the data column containing the 'y'
coordinates in meters or degrees. Ignored if data is of class SpatVector
or Spatial, and ignored for distance calculations if |
dem |
(Optional) A SpatRaster or Raster object to use for slope and
topographic wetness calculations. Default is |
proj |
A crs object or character string representing the projection
information for x,y coordinates. If z_fix is provided, default is for
|
z_fix |
A raster with the origin, projection, and resolution of the desired output rasters. |
zoom |
Considered only if |
z_min |
The minimum allowable elevation. Useful if DEM source includes
ocean bathymetry as does the SRTM data from AWS. Default is |
filt |
Numeric. Size of moving window to apply a low-pass filter to
terrain-based metrics ( |
slope |
Logical. Should the slope at each input location be calculated?
Default uses SRTM data from |
twi |
Logical. Should the topgraphic wetness index be calculated?
Default uses the provided |
depth |
Logical. Should the depth to bedrock be obtained? If TRUE, SoilGrids v. 1.0 data are downloaded from ISRIC SoilGrids. Unfortunately, these data are only provided globally and therefore the download is 1.34 GB. |
soils |
A character vector containing zero, all or, some of
|
climate |
A character vector containing zero, all or, some of
c("tmin","tavg","tmax","prec","srad") representing the minimum average temperature,
average temperature, maximum average temperature, precipitation, and solar radiation.
Data are downloaded from WorldClim v. 2
using |
acc |
One of (1) A Raster or SpatRaster representing the flow accumulation
in units of incoming per cell, or (2) an integer equal to one of
|
vars |
A SpatRaster object (or something coercible to it using the
|
overwrite |
Should the |
dir |
A filepath to the directory being used as the workspace.
Default is |
... |
Additional parameters to pass to |
A folder in the 'dir' with the requested datasets.
# Get coordinates for Mexico City in longlat
data <- data.table(x = -99.1332,
y = 19.4326)
## Not run due to size of downloads
# getEnv(data, filt = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.