Skip to contents

Calculate compositional diversity and associatum of landscape data at different spatial scales.

Usage

LandComp(
  x,
  aggregation_steps = c(0, 1, 1.5, 2:5),
  parallelrun = TRUE,
  savememory = FALSE,
  precision = 4
)

Arguments

x

An sf object of type POLYGON that must have projected coordinates (i.e. WGS-84 is not accepted). Geometry must be a regular spatial grid containing either squares or hexagons. Both flat topped and pointy topped hexagons are accepted. Fields should contain binary integer values (i.e., 0s and 1s). Logical values are coerced with warning.

aggregation_steps

A numeric vector containing non-negative numbers. The vector elements express the size of the spatial units for which calculation of compositional diversity and associatum is required. The size is measured by the number of rows of grid cells around the central grid cell, where 0 means the original grid cell without enlargement. Analysis can be done more precise by giving also fraction numbers as input. In this case, the following step's spatial unit minus grid cells touching the vertices are used as spatial base units. Note, in the case of hexagonal grid, steps falling in the interval ]0,1[ cannot be evaluated. Negative, non-finite and missing values are ignored with warning.

parallelrun

A logical vector of length one indicating whether aggregation should be performed in a parallel way (defaults to TRUE). All available processor cores are used in the case of parallel processing. Should be set to FALSE if memory limitation occurs.

savememory

A logical vector of length one indicating whether a slower but less memory-demanding algorithm should run (defaults to FALSE). Should be set to TRUE if the available memory is limited.

precision

A numeric vector of length one. Number of digits to which the areas of grid cells are rounded. Should be decreased if the grid is not perfectly regular and the equality check of the grid cells' area fails.

Value

A data.frame of length(aggregation_steps) rows with the following columns and attribute:

  • AggregationStep: size of the spatial units measured by the number of rows of grid cells around the central grid cell. The content (and order) of this column is the same as the parameter aggregation_steps except that negative, non-finite and missing values are removed. It also serves as an ID in the resulting data.frame.

  • SpatialUnit_Size: number of grid cells contained by the aggregated, large unit.

  • SpatialUnit_Area: area of the aggregated, large unit

  • SpatialUnit_Count: sample size.

  • UniqueCombination_Count: number of unique landscape class combinations.

  • CD_bit: compositional diversity (sensu Juhász-Nagy) of x.

  • AS_bit: associatum (sensu Juhász-Nagy) of x

  • attr(*, "unit"): unit of the CRS of the object provided to x.

Details

The function is based on the model family created by Juhász-Nagy (1976, 1984, 1993). Compositional diversity (CD) measures the diversity of landscape class combinations. Associatum (AS) characterizes the spatial dependence of landscape classes. It is measured as the difference of the "random" diversity (i.e. predicted diversity with the assumption of independent occurrence of landscape classes) and the observed diversity. Both functions have typically one maximum (CDmax, ASmax), when plotting against increasing scale. Unit sizes corresponding to the maxima values of both functions (ACD, ACD) help to capture the spatial scale holding the most information. These indices, particularly CDmax, ASmax and ACD can be effectively used as indicators (Juhász-Nagy & Podani 1983). Though the functions were originally applied in community ecology, the current function supports their application in the landscape context (see also Konrád et al. 2023).

References

  • Juhász-Nagy P (1976) Spatial dependence of plant populations. Part 1. Equivalence analysis (An outline of new model). Acta Bot Acad Sci Hung 22: 61–78.

  • Juhász-Nagy P (1984) Spatial dependence of plant population. 2. A family of new models. Acta Bot Hung 30: 363–402.

  • Juhász-Nagy P (1993) Notes on compositional diversity. Hydrobiologia 249: 173–182.

  • Juhász-Nagy P, Podani J (1983) Information theory methods for the study of spatial processes and succession. Vegetatio 51: 129–140.

  • Konrád KD, Bede-Fazekas Á, Bartha S, Somodi I (2023) Adapting a multiscale approach to assess the compositional diversity of landscapes. Landsc Ecol 38: 2731–2747.

Examples

data(square_data)
LandComp(x = square_data, aggregation_steps = 0)
#>   AggregationStep SpatialUnit_Size SpatialUnit_Area SpatialUnit_Count
#> 1               0                1          2.5e+07               300
#>   UniqueCombination_Count   CD_bit    AS_bit
#> 1                      13 2.755349 0.1709469

# \donttest{
LandComp(x = square_data, aggregation_steps = 0, parallelrun = FALSE)
#>   AggregationStep SpatialUnit_Size SpatialUnit_Area SpatialUnit_Count
#> 1               0                1          2.5e+07               300
#>   UniqueCombination_Count   CD_bit    AS_bit
#> 1                      13 2.755349 0.1709469
LandComp(x = square_data, aggregation_steps = c(0.5, 1, 1.5))
#>   AggregationStep SpatialUnit_Size SpatialUnit_Area SpatialUnit_Count
#> 1             0.5                5         1.25e+08               234
#> 2             1.0                9         2.25e+08               234
#> 3             1.5               21         5.25e+08               176
#>   UniqueCombination_Count   CD_bit    AS_bit
#> 1                      18 3.572889 0.7480368
#> 2                      18 3.176364 1.0874836
#> 3                      11 2.165865 1.2497731

data(hexagonal_data)
LandComp(x = hexagonal_data, aggregation_steps = c(0, 1, 1.5))
#>   AggregationStep SpatialUnit_Size SpatialUnit_Area SpatialUnit_Count
#> 1             0.0                1         866025.4               300
#> 2             1.0                7        6062177.8               234
#> 3             1.5               13       11258330.2               187
#>   UniqueCombination_Count   CD_bit    AS_bit
#> 1                      12 1.972863 0.1256525
#> 2                      16 3.422409 0.5394512
#> 3                      21 3.487383 0.5487755
# }