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

spatialize_lsm

spatialize_lsm


Description

Spatialize landscape metric values

Usage

spatialize_lsm(
  landscape,
  level,
  metric,
  name,
  type,
  what,
  directions,
  progress,
  to_disk,
  ...
)

## S3 method for class 'RasterLayer'
spatialize_lsm(
  landscape,
  level = "patch",
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  progress = FALSE,
  to_disk = getOption("to_disk", default = FALSE),
  ...
)

## S3 method for class 'RasterStack'
spatialize_lsm(
  landscape,
  level = "patch",
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  progress = FALSE,
  to_disk = getOption("to_disk", default = FALSE),
  ...
)

## S3 method for class 'RasterBrick'
spatialize_lsm(
  landscape,
  level = "patch",
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  progress = FALSE,
  to_disk = getOption("to_disk", default = FALSE),
  ...
)

## S3 method for class 'stars'
spatialize_lsm(
  landscape,
  level = "patch",
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  progress = FALSE,
  to_disk = getOption("to_disk", default = FALSE),
  ...
)

## S3 method for class 'list'
spatialize_lsm(
  landscape,
  level = "patch",
  metric = NULL,
  name = NULL,
  type = NULL,
  what = NULL,
  directions = 8,
  progress = FALSE,
  to_disk = getOption("to_disk", default = 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).

progress

Print progress report.

to_disk

If TRUE raster will be saved to disk.

...

Arguments passed on to calculate_lsm().

Details

The functions returns a nested list with RasterLayers. The first level contains each input layer (only one element if RasterLayer was provided). The second level contains a RasterLayer for each selected metric (see list_lsm for details) where each cell has the landscape metric value of the patch it belongs to. Only patch level metrics are allowed.

Value

list

See Also

Examples

spatialize_lsm(landscape, what = "lsm_p_area")

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.