raster.read: Read and buffer raster layers.

Description Usage Arguments Details Value References Examples

View source: R/red.R

Description

Read raster layers of environmental or other variables and crop them to a given extent around the known occurrences.

Usage

1
raster.read(longlat, layers = NULL, ext = 1)

Arguments

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.

Details

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.

Value

A RasterStack object (If no layers are given: Variables 1-19 = bioclim, 20 = elevation, 21-32 = proportion landcover, 33 = most common landcover).

References

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.

Examples

1
2
3
4
5
6
7
8
data(red.layers)
data(red.records)
par(mfrow=c(1,2))
raster::plot(red.layers[[1]])
points(red.records)
croppedLayers <- raster.read(red.records, red.layers, 0.1)
raster::plot(croppedLayers[[1]])
points(red.records)

red documentation built on Nov. 17, 2017, 4:53 a.m.