reserve_perimeter: Calculate the perimeter of a reserve network

Description Usage Arguments Value Examples

View source: R/reserve-perimeter.r

Description

Calculate the perimeter of a reserve network

Usage

1
reserve_perimeter(pu, x, units = c("km", "m"))

Arguments

pu

raster::RasterStack, sp::SpatialPolygonsDataFrame, or sf::sf object; planning units and representation levels of features as layers (raster inputs) or columns (vector inputs).

x

logical or binary; indicator variables specifying which planning units are included.

units

character; metapopulation capacity depends on the units used for the areas and distances, this argument determines whether these are measured in meters or kilometers.

Value

A units object giving the reserve perimeter in the specified units.

Examples

1
2
3
4
r <- raster::raster(nrows = 10, ncols = 10, crs = "+proj=aea",
                    vals = sample(0:1, 100, replace = TRUE))
selected <- sample(c(FALSE, TRUE), 100, replace = TRUE, prob = c(0.7, 0.3))
reserve_perimeter(r, selected)

mstrimas/metacapa documentation built on Dec. 3, 2019, 3:16 p.m.