Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calculate_lsm

calculate_lsm


Description

Calculate a selected group of metrics

Usage

calculate_lsm(
  landscape,
  level,
  metric,
  name,
  type,
  what,
  directions,
  count_boundary,
  consider_boundary,
  edge_depth,
  cell_center,
  classes_max,
  neighbourhood,
  ordered,
  base,
  full_name,
  verbose,
  progress
)

## S3 method for class 'RasterLayer'
calculate_lsm(
  landscape,
  level = NULL,
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  count_boundary = FALSE,
  consider_boundary = FALSE,
  edge_depth = 1,
  cell_center = FALSE,
  classes_max = NULL,
  neighbourhood = 4,
  ordered = TRUE,
  base = "log2",
  full_name = FALSE,
  verbose = TRUE,
  progress = FALSE
)

## S3 method for class 'RasterStack'
calculate_lsm(
  landscape,
  level = NULL,
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  count_boundary = FALSE,
  consider_boundary = FALSE,
  edge_depth = 1,
  cell_center = FALSE,
  classes_max = NULL,
  neighbourhood = 4,
  ordered = TRUE,
  base = "log2",
  full_name = FALSE,
  verbose = TRUE,
  progress = FALSE
)

## S3 method for class 'RasterBrick'
calculate_lsm(
  landscape,
  level = NULL,
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  count_boundary = FALSE,
  consider_boundary = FALSE,
  edge_depth = 1,
  cell_center = FALSE,
  classes_max = NULL,
  neighbourhood = 4,
  ordered = TRUE,
  base = "log2",
  full_name = FALSE,
  verbose = TRUE,
  progress = FALSE
)

## S3 method for class 'stars'
calculate_lsm(
  landscape,
  level = NULL,
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  count_boundary = FALSE,
  consider_boundary = FALSE,
  edge_depth = 1,
  cell_center = FALSE,
  classes_max = NULL,
  neighbourhood = 4,
  ordered = TRUE,
  base = "log2",
  full_name = FALSE,
  verbose = TRUE,
  progress = FALSE
)

## S3 method for class 'list'
calculate_lsm(
  landscape,
  level = NULL,
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  count_boundary = FALSE,
  consider_boundary = FALSE,
  edge_depth = 1,
  cell_center = FALSE,
  classes_max = NULL,
  neighbourhood = 4,
  ordered = TRUE,
  base = "log2",
  full_name = FALSE,
  verbose = TRUE,
  progress = FALSE
)

Arguments

landscape

Raster* Layer, Stack, Brick, SpatRaster (terra), stars, or a list of rasterLayers.

level

Level of metrics. Either 'patch', 'class' or 'landscape' (or vector with combination).

metric

Abbreviation of metrics (e.g. 'area').

name

Full name of metrics (e.g. 'core area').

type

Type according to FRAGSTATS grouping (e.g. 'aggregation metrics').

what

Selected level of metrics: either "patch", "class" or "landscape". It is also possible to specify functions as a vector of strings, e.g. what = c("lsm_c_ca", "lsm_l_ta").

directions

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

count_boundary

Include landscape boundary in edge length.

consider_boundary

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

edge_depth

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

cell_center

If true, the coordinates of the centroid are forced to be a cell center within the patch.

classes_max

Potential maximum number of present classes.

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.

full_name

Should the full names of all functions be included in the tibble.

verbose

Print warning messages.

progress

Print progress report.

Details

Wrapper to calculate several landscape metrics. The metrics can be specified by the arguments what, level, metric, name and/or type (combinations of different arguments are possible (e.g. level = "class", type = "aggregation metric"). If an argument is not provided, automatically all possibilities are selected. Therefore, to get all available metrics, don't specify any of the above arguments.

Value

tibble

References

McGarigal, K., SA Cushman, and E Ene. 2012. FRAGSTATS v4: Spatial Pattern Analysis Program for Categorical and Continuous Maps. Computer software program produced by the authors at the University of Massachusetts, Amherst. Available at the following web site: http://www.umass.edu/landeco/research/fragstats/fragstats.html

See Also

Examples

## Not run: 
calculate_lsm(landscape, progress = TRUE)
calculate_lsm(landscape, what = c("patch", "lsm_c_te", "lsm_l_pr"))
calculate_lsm(landscape, level = c("class", "landscape"), type = "aggregation metric")

## End(Not run)

landscapemetrics

Landscape Metrics for Categorical Map Patterns

v1.5.2
GPL-3
Authors
Maximillian H.K. Hesselbarth [aut, cre] (<https://orcid.org/0000-0003-1125-9918>), Marco Sciaini [aut] (<https://orcid.org/0000-0002-3042-5435>), Jakub Nowosad [aut] (<https://orcid.org/0000-0002-1057-3721>), Sebastian Hanss [aut] (<https://orcid.org/0000-0002-3990-4897>), Laura J. Graham [ctb] (Input on package structure), Jeffrey Hollister [ctb] (Input on package structure), Kimberly A. With [ctb] (Input on package structure), Florian Privé [ctb] (Original author of underlying C++ code for get_nearestneighbour() function), Project Nayuki [ctb] (Original author of underlying C++ code for get_circumscribingcircle and lsm_p_circle), Matt Strimas-Mackey [ctb] (Bugfix in sample_metrics())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.