Title: Analysing Landscape Composition and Structure at Multiple Scales
Version: 0.0.5
Description: Changes of landscape diversity and structure can be detected soon if relying on landscape class combinations and analysing patterns at multiple scales. 'LandComp' provides such an opportunity, based on Juhász-Nagy's functions (Juhász-Nagy P, Podani J 1983 <doi:10.1007/BF00129432>). Functions can handle multilayered data. Requirements of the input: binary data contained by a regular square or hexagonal grid, and the grid should have projected coordinates.
License: MIT + file LICENSE
Suggests: knitr, rmarkdown, testthat
Encoding: UTF-8
Language: En
RoxygenNote: 7.3.0
Imports: future, future.apply, sf
Depends: R (≥ 2.10)
LazyData: true
VignetteBuilder: knitr
URL: https://github.com/ladylavender/LandComp, https://ladylavender.github.io/LandComp/
BugReports: https://github.com/ladylavender/LandComp/issues
NeedsCompilation: no
Packaged: 2024-02-05 19:05:20 UTC; Kriszti
Author: Krisztina Dóra Konrád ORCID iD [aut, cre, cph], Ákos Bede-Fazekas ORCID iD [aut, ths, cph], Sándor Bartha ORCID iD [cph], Imelda Somodi ORCID iD [ccp, ths, cph]
Maintainer: Krisztina Dóra Konrád <konrad.krisztina@ecolres.hu>
Repository: CRAN
Date/Publication: 2024-02-06 17:30:08 UTC

LandComp: quantify landscape diversity and structure

Description

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.

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).

Value

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

References

Examples

data(square_data)
LandComp(x = square_data, aggregation_steps = 0)


LandComp(x = square_data, aggregation_steps = 0, parallelrun = FALSE)
LandComp(x = square_data, aggregation_steps = c(0.5, 1, 1.5))

data(hexagonal_data)
LandComp(x = hexagonal_data, aggregation_steps = c(0, 1, 1.5))



Number of grid cells covered by enlarged spatial units

Description

Calculate the number of grid cells covered by the radially enlarged spatial units.

Usage

calculate_SpatialUnitSize(aggregation_step, square = FALSE)

Arguments

aggregation_step

A numeric vector of length one containing a non-negative number. This number expresses 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 cell without enlargement. Fraction number can be also set 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.

square

A logical vector of length one. Should be TRUE if square grid, FALSE, if is hexagonal grid is used as the basis of calculation.

Value

A numeric vector of length one.

Examples

calculate_SpatialUnitSize(aggregation_step = 0, square = TRUE)

foo = c()
for(i in c(0, 0.5, 1, 1.5, 2, 3))
  foo = c(foo, calculate_SpatialUnitSize(aggregation_step = i, square = TRUE))
foo

vapply(c(0, 1, 1.5, 2, 3), FUN = function(i){
  calculate_SpatialUnitSize(aggregation_step = i, square = FALSE)},
  FUN.VALUE = numeric(length = 1))


Sample vegetation data with hexagonal grid

Description

A generated dataset containing presences and absences of five vegetation types.

Usage

data(hexagonal_data)

Format

An sf object with 300 rows and 6 variables.

Author(s)

Krisztina Dóra Konrád konrad.krisztina@ecolres.hu


Sample vegetation data with square grid

Description

A generated dataset containing presences and absences of five vegetation types.

Usage

data(square_data)

Format

An sf object with 300 rows and 6 variables.

Author(s)

Krisztina Dóra Konrád konrad.krisztina@ecolres.hu

mirror server hosted at Truenetwork, Russian Federation.