raster.distance: Create distance layer.

Description Usage Arguments Details Value Examples

View source: R/red.R

Description

Creates a layer depicting distances to records using the minimum, average, distance to the minimum convex polygon or distance taking into account a cost surface.

Usage

1
raster.distance(longlat, layers, type = "minimum")

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 to serve as model to create distance layer. Cost surface in case of param ="cost".

type

text string indicating whether the output should be the "minimum", "average", "mcp" or "cost" distance to all records. "mcp" means the distance to the minimum convex polygon encompassing all records.

Details

Using distance to records in models may help limiting the extrapolation of the predicted area much beyond known areas.

Value

A RasterLayer object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(red.layers)
alt = red.layers[[3]]
data(red.records)
par(mfrow=c(3,2))
raster::plot(alt)
points(red.records)
raster::plot(raster.distance(red.records, alt))
raster::plot(raster.distance(red.records, alt, type = "average"))
raster::plot(raster.distance(red.records, alt, type = "mcp"))
raster::plot(raster.distance(red.records, alt, type = "cost"))

cardosopmb/red documentation built on May 13, 2020, 2:04 p.m.