Skip to contents

Metrics on changing sample scale

Usage

scale_sample(
  landscape,
  y,
  shape = "square",
  size,
  transform = TRUE,
  verbose = TRUE,
  progress = FALSE,
  ...
)

Arguments

landscape

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

y

Point geometry as SpatVector or sf object or 2-column matrix with coordinates.

shape

String specifying plot shape. Either "circle" or "square"

size

Approximated size of sample plot. Equals the radius for circles or half of the side-length for squares in mapunits. For lines size equals the width of the buffer.

transform

Logical if planar CRS are transformed to lon/lat for accuracy during area calculations of buffer areas.

verbose

Print warning messages.

progress

Print progress report.

...

Arguments passed on to calculate_lsm().

Value

tibble

Details

This function calculates the selected metrics in sub-sequential buffers around point(s) of interest. To see more details about arguments passed on to the metrics, please see calculate_lsm().

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.

For all metrics based on distances or areas please make sure your data is valid using check_landscape.

Please be aware that the output is slightly different to all other lsm-function of landscapemetrics.

The size of the actual sampled landscape can be different to the provided size due to two reasons. Firstly, because clipping raster cells using a circle or a sample plot not directly at a cell center lead to inaccuracies. Secondly, sample plots can exceed the landscape boundary. Therefore, we report the actual clipped sample plot area relative in relation to the theoretical, maximum sample plot area e.g. a sample plot only half within the landscape will have a percentage_inside = 50. Additionally, if the polygon representing the sample plot is smaller than the cell size of the raster, the percentage_inside may exceed 100%. To calculate the area of the buffer zones, the function terra::expanse() is used. The area results may be influenced by the CRS and the transform argument.

Examples

my_points <- matrix(c(1265000, 1250000, 1255000, 1257000), ncol = 2, byrow = TRUE)
my_points <- terra::vect(my_points, crs = terra::rast(landscapemetrics::augusta_nlcd))

scale_sample(landscape = terra::rast(landscapemetrics::augusta_nlcd), y = my_points,
size = c(500, 750, 1000), what = c("lsm_l_ent", "lsm_l_mutinf"))
#> # A tibble: 12 × 9
#>    layer level     class    id metric value  size plot_id percentage_inside
#>    <int> <chr>     <int> <int> <chr>  <dbl> <dbl>   <int>             <dbl>
#>  1     1 landscape    NA    NA ent    2.57    500       1              98.0
#>  2     1 landscape    NA    NA ent    2.77    750       1             100. 
#>  3     1 landscape    NA    NA ent    2.93   1000       1             101. 
#>  4     1 landscape    NA    NA mutinf 0.950   500       1              98.0
#>  5     1 landscape    NA    NA mutinf 1.05    750       1             100. 
#>  6     1 landscape    NA    NA mutinf 1.25   1000       1             101. 
#>  7     1 landscape    NA    NA ent    2.22    500       2             101. 
#>  8     1 landscape    NA    NA ent    2.48    750       2             100. 
#>  9     1 landscape    NA    NA ent    2.46   1000       2              99.5
#> 10     1 landscape    NA    NA mutinf 1.03    500       2             101. 
#> 11     1 landscape    NA    NA mutinf 1.07    750       2             100. 
#> 12     1 landscape    NA    NA mutinf 1.04   1000       2              99.5