prepare_extras {landscapemetrics}R Documentation

prepare_extras

Description

Prepare an extras object

Usage

prepare_extras(
  metrics,
  landscape_mat,
  directions,
  neighbourhood,
  ordered,
  base,
  resolution
)

Arguments

metrics

A vector with metric abbreviations

landscape_mat

A matrix object

directions

The number of directions in which patches should be connected: 4 (rook's case) or 8 (queen's case).

neighbourhood

The number of directions in which cell adjacencies are considered as neighbours: 4 (rook's case) or 8 (queen's case). The default is 4.

ordered

The type of pairs considered. Either ordered (TRUE) or unordered (FALSE). The default is TRUE.

base

The unit in which entropy is measured. The default is "log2", which compute entropy in "bits". "log" and "log10" can be also used.

resolution

A vector with two numbers (usually calculated using terra::res)

Details

Wrapper around terra::xyFromCell and terra::getValues to get raster_to_points function including NA values

Value

A list with zero or more of the following components:

See Also

get_points, get_class_patches, get_area_patches, get_complexity, get_enn_patch

Examples

landscape <- terra::rast(landscapemetrics::landscape)
landscape_mat <- terra::as.matrix(landscape, wide = TRUE)
prepare_extras("lsm_l_ent", landscape_mat, neighbourhood = 4, base = "log2")

## Not run: 
metrics = list_lsm()$function_name
landscape <- terra::rast(landscapemetrics::landscape)
landscape_mat <- terra::as.matrix(landscape, wide = TRUE)
prepare_extras(metrics, landscape_mat, directions = 8, neighbourhood = 4,
               ordered = FALSE, base = "log2", resolution = terra::res(landscape))

## End(Not run)


[Package landscapemetrics version 2.1.4 Index]