get_boundaries: get_boundaries

Description Usage Arguments Details Value Examples

View source: R/get_boundaries.R

Description

Get boundary cells of patches

Usage

1
2
3
4
5
6
7
8
get_boundaries(
  landscape,
  consider_boundary = FALSE,
  edge_depth = 1,
  as_NA = FALSE,
  patch_id = FALSE,
  return_raster = TRUE
)

Arguments

landscape

RasterLayer or matrix.

consider_boundary

Logical if cells that only neighbour the landscape boundary should be considered as edge.

edge_depth

Distance (in cells) a cell has the be away from the patch edge to be considered as core cell.

as_NA

If true, non-boundary cells area labeld NA.

patch_id

If true, boundary/edge cells are labeled with the original patch id.

return_raster

If false, matrix is returned.

Details

All boundary/edge cells are labeled 1, all non-boundary cells 0. NA values are not changed. Boundary cells are defined as cells that neighbour either a NA cell or a cell with a different value than itself. Non-boundary cells only neighbour cells with the same value than themself.

Value

List with RasterLayer or matrix

Examples

1
2
3
4
class_1 <- get_patches(landscape, class = 1)[[1]]

get_boundaries(class_1)
get_boundaries(class_1, return_raster = FALSE)

landscapemetrics documentation built on Sept. 5, 2021, 5:20 p.m.