Title: Boltzmann Entropy of a Landscape Gradient
Version: 1.5.3
Description: Calculates the Boltzmann entropy of a landscape gradient. This package uses the analytical method created by Gao, P., Zhang, H. and Li, Z., 2018 (<doi:10.1111/tgis.12315>) and by Gao, P. and Li, Z., 2019 (<doi:10.1007/s10980-019-00854-3>). It also extend the original ideas by allowing calculations on data with missing values.
License: MIT + file LICENSE
Encoding: UTF-8
ByteCompile: true
RoxygenNote: 7.2.2
Depends: R (≥ 3.3.0)
LinkingTo: Rcpp, RcppArmadillo
Imports: Rcpp
Suggests: testthat, sp, raster, covr, knitr, rmarkdown, ggplot2, rasterVis, stars, terra
URL: https://r-spatialecology.github.io/belg/
BugReports: https://github.com/r-spatialecology/belg/issues
VignetteBuilder: knitr
NeedsCompilation: yes
Packaged: 2022-12-15 15:07:28 UTC; jn
Author: Jakub Nowosad ORCID iD [aut, cre], Space Informatics Lab [cph]
Maintainer: Jakub Nowosad <nowosad.jakub@gmail.com>
Repository: CRAN
Date/Publication: 2022-12-15 15:30:03 UTC

belg: Boltzmann Entropy of a Landscape Gradient

Description

Calculates the Boltzmann entropy of a landscape gradient. This package uses the analytical method created by Gao, P., Zhang, H. and Li, Z., 2018 (doi:10.1111/tgis.12315) and by Gao, P. and Li, Z., 2019 (doi:10.1007/s10980-019-00854-3). It also extend the original ideas by allowing calculations on data with missing values.

Author(s)

Maintainer: Jakub Nowosad nowosad.jakub@gmail.com (ORCID)

Other contributors:

See Also

Useful links:


Boltzmann entropy of a landscape gradient

Description

Calculates the Boltzmann entropy of a landscape gradient

Usage

get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## Default S3 method:
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'matrix'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'array'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'RasterLayer'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'RasterStack'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'RasterBrick'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = FALSE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'stars'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

## S3 method for class 'SpatRaster'
get_boltzmann(
  x,
  method = "aggregation",
  na_adjust = TRUE,
  base = "log10",
  relative = FALSE
)

Arguments

x

SpatRaster, stars, RasterLayer, RasterStack, RasterBrick, matrix, or array.

method

A method used. Either "hierarchy" for the hierarchy-based method (Gao et al., 2017) or "aggregation" (default) for the aggregation-based method (Gao et al., 2019).

na_adjust

Should the output value be adjusted to the proportion of not missing cells? Either TRUE (default) or FALSE

base

A logarithm base ("log", "log2" or "log10").

relative

Should a relative or absolute entropy be calculated? TRUE or FALSE (default).

Details

The method for computing the Boltzmann entropy of a landscape gradient works on integer values that are either positive or equals to zero. This function automatically rounds values to the nearest integer value (rounding halfway cases away from zero) and negative values are shifted to positive values.

Value

a numeric vector

References

Gao, Peichao, Hong Zhang, and Zhilin Li. "A hierarchy-based solution to calculate the configurational entropy of landscape gradients." Landscape Ecology 32.6 (2017): 1133-1146.

Gao, Peichao, Hong Zhang, and Zhilin Li. "An efficient analytical method for computing the Boltzmann entropy of a landscape gradient." Transactions in GIS (2018).

Gao, Peichao and Zhilin Li. "Aggregation-based method for computing absolute Boltzmann entropy of landscape gradient with full thermodynamic consistency" Landscape Ecology (2019)

Examples

new_c = c(56, 86, 98, 50, 45, 56, 96, 25,
          15, 55, 85, 69, 12, 52, 25, 56,
          32, 25, 68, 98, 58, 66, 56, 58)


lg = matrix(new_c, nrow = 3, ncol = 8, byrow = TRUE)
get_boltzmann(lg, relative = FALSE, method = "hierarchy", base = "log10")
get_boltzmann(lg, relative = TRUE, method = "hierarchy", base = "log2")
get_boltzmann(lg, relative = TRUE, method = "hierarchy", base = "log")