raster.read | R Documentation |
Read raster layers of environmental or other variables and crop them to a given extent around the known occurrences.
raster.read(longlat, layers = NULL, ext = 1)
longlat |
Matrix of longitude and latitude or eastness and northness (two columns in this order) of species occurrence records. |
layers |
Raster* object as defined by package raster. |
ext |
Either extent of map or buffer around the known records used to crop layers. If buffer, it is relative to the maximum distance between any two records. |
If layers are not given, the function will read either 30 arc-second (approx. 1km) or 5 arc-minutes (approx. 10km) resolution rasters from worldclim (Fick & Hijmans 2017) and landcover (Tuanmu & Jetz 2014) if red.setup() is run previously.
A RasterStack object (If no layers are given: Variables 1-19 = bioclim, 20 = elevation, 21-32 = proportion landcover, 33 = most common landcover).
Fick, S.E. & Hijmans, R.J. (2017) Worldclim 2: new 1-km spatial resolution climate surfaces for global land areas. International Journal of Climatology, in press.
Tuanmu, M.-N. & Jetz, W. (2014) A global 1-km consensus land-cover product for biodiversity and ecosystem modeling. Global Ecology and Biogeography, 23: 1031-1045.
layers = red.examples("red.layers")
records = red.examples("red.records")
par(mfrow=c(1,2))
terra::plot(layers[[1]])
points(records)
croppedLayers <- raster.read(records, layers, 0.1)
terra::plot(croppedLayers[[1]])
points(records)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.