Learn R Programming

prior3D (version 0.1.5)

coherence: Coherence metrics

Description

Coherence metrics

Usage

coherence(x, w, metric = "sa", normalize = TRUE, plot = TRUE, addlines = TRUE, ...)

Value

numeric vector with 2D and 3D metrics. The result maps are optionally ploted.

Arguments

x

Output of Compare_2D_3D function.

w

Integer indicating square window dimensions.

metric

Cohension metric to use. It must be one of "sa", "sku" and "rao"

normalize

If TRUE, then sum of solutions is normalized at a \([0,1]\) scale.

plot

If TRUE, then coherence maps are ploted.

addlines

If TRUE, then border lines from maps::map are ploted.

...

Further arguments passed in function, based on metric choice. See more in Details.

Details

"sa" and "sku" are derived from geodiv::focal_metrics and in ellipsis (...) further arguments of geodiv::focal_metrics are passed.

metric = "rao" is derived from rasterdiv::paRao and in ellipsis (...) further arguments of rasterdiv::paRao are passed.

References

Rocchini, Duccio, Matteo Marcantonio, Daniele Da Re, Giovanni Bacaro, Enrico Feoli, Giles Foody, Reinhard Furrer, et al. 2021. "From zero to infinity: Minimum to maximum diversity of the planet by spatio-parametric Rao’s quadratic entropy." Global Ecology and Biogeography 30 (5): 2315. tools:::Rd_expr_doi("10.1111/geb.13270").

Rocchini, Duccio, Elisa Thouverai, Matteo Marcantonio, Martina Iannacito, Daniele Da Re, Michele Torresani, Giovanni Bacaro, et al. 2021. "rasterdiv - An Information Theory tailored R package for measuring ecosystem heterogeneity from space: To the origin and back." Methods in Ecology and Evolution 12 (6): 2195. tools:::Rd_expr_doi("10.1111/2041-210X.13583").

Smith, Annie C., Phoebe Zarnetske, Kyla Dahlin, Adam Wilson, and Andrew Latimer. 2023. Geodiv: Methods for Calculating Gradient Surface Metrics. https://CRAN.R-project.org/package=geodiv.

Becker OScbRA, Minka ARWRvbRBEbTP, Deckmyn. A (2023). maps: Draw Geographical Maps. R package version 3.4.2, https://CRAN.R-project.org/package=maps

See Also

Compare_2D_3D

Examples

Run this code
if (FALSE) {
## This example requires commercial solver from 'gurobi' package for
## portfolio = "gap". Else replace it with e.g. portfolio = "shuffle" for using
## a free solver like the one from 'highs' package.

biodiv_raster <- get_biodiv_raster()
depth_raster <- get_depth_raster()
data(biodiv_df)

out_2D_3D <- Compare_2D_3D(biodiv_raster = biodiv_raster,
                           depth_raster = depth_raster,
                           breaks = c(0, -40, -200, -2000, -Inf),
                           biodiv_df = biodiv_df,
                           budget_percents = seq(0, 1, 0.1),
                           budget_weights = "richness",
                           threads = parallel::detectCores(),
                           portfolio = "gap",
                           portfolio_opts = list(number_solutions = 10))

coherence(out_2D_3D, w = 3, metric = "sa")
coherence(out_2D_3D, w = 3, metric = "sku")
coherence(out_2D_3D, w = 3, metric = "rao")
}

Run the code above in your browser using DataLab