Based on two continuous environmental variables, it defines a bi-dimensional environmental space.

define_env_space(env, buffer.size, plot = TRUE)

Arguments

env

matrix or data frame with two columns containing two environmental variables. The variables must be numeric, even for data frames.

buffer.size

numeric value indicating a buffer size around each point which will delimit the environmental geographical border for the occurrence point. See details.

plot

logical. whether to plot the polygon. Default is TRUE.

Value

An object of sfc_POLYGON class

Details

The environmental variables are standardized by range, which turns the range of each environmental variable from 0 to 1. Then, it is delimited a buffer of size equal to buffer.size around each point in this space and a polygon is draw to link these buffers. The function returns the polygon needed to link all points, and the area of the polygon indicates the environmental space based in the variables used.

Examples

library("raster") # load climate data data("r.temp.prec") env.data <- raster::as.data.frame(r.temp.prec) define_env_space(env.data, 0.05)
#> Geometry set for 1 feature #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: 0 ymin: 0 xmax: 1 ymax: 1 #> CRS: NA
#> POLYGON ((0 0.1359022, 0.002104415 0.1364074, 0...