Skip to contents

The `comspat()` function calculates Juhász-Nagy Information Theory models.

Usage

comspat(
  data = NULL,
  params = NULL,
  dim_max = NULL,
  type = NULL,
  measures = NULL,
  randomization_type = NULL,
  iterations = 999,
  alpha = NULL
)

Arguments

data

A matrix or data frame capturing the spatial coordinate(s) of species sampled from a grid or transect. Each row captures the coordinate(s) of a `Species`. If the `data` was sampled as a Transect only the `X` coordinate is required. If the `data` was sampled as a Grid both `X` and `Y` coordinates are required.

params

Data frame providing the secondary sampling information.

dim_max

Numeric. Number of sampling units in one row of a `"Grid"` or `"Transect"`.

type

Character. Supply either `"Grid"` or `"Transect"`.

measures

Vector. List the measures returned by `comspat()`. The default option returns the compositional diversity `"CD"`, number of realized species combinations `"NRC"` and associatum `"AS"`. Relative associatum `"AS_REL"` is returned by default when `"AS"` is called.

randomization_type

Character. Supply either `"CSR"` or `"RS"`. Activating randomization initiates parallel computing.

iterations

Numeric. Number of randomizations. The default is 999.

alpha

Numeric. If `NULL`, p value returned. Else 1 or 0.

Value

The function returns an object of class list returning named data frames. The variables populating the data frames are specified by the `measures` and/or the `randomization_type` arguments. To understand the different JNP functions we strongly recommend reviewing the work of Bartha et al. (1998).

The following components are included within the returned object if no `randomization_type` is specified:

  • CD - A matrix showing the Compositional Diversity (CD) calculated for each spatial scale. CD measures the entropy of species combinations. Each spatial scale is referred to as "step" and is labeled as columns. Rows are labeled by the species involved in the calculation of CD.

  • NRC - A matrix showing the Number of Realized Combinations (NRC) calculated for each spatial scale. NRC measures the number of species combinations. Each spatial scale is referred to as "step" and is labeled as columns. Rows are labeled by the species involved in the calculation of NRC.

  • AS - A matrix showing the overall association (associatum [AS]) for the collection of species calculated for each spatial scale. AS reflects the spatial similarity and dissimilarity structure of the grid or transect. Rows are labeled according to the species involved in the calculation of AS.

  • AS_REL - A matrix showing the relative association (AS_REL) for the collection of species calculated for each spatial scale. AS_REL reflects the spatial similarity and dissimilarity structure of the grid or transect divided by CD. AS_REL should be used when comparing grids or transects containing different species richness.

  • S_RICH - A matrix showing the number of species for each spatial scale.

  • H - A matrix showing the Shannon diversity of species for each spatial scale.

The following components are included within the returned object if a randomization_type is specified:

  • Raw data - Contains the maximum values for each of the measures (i.e., CD, NRC, AS, AS_REL, descriptions above) for each spatial scale obtained by randomization. The result of each randomization is provided as rows.

  • Summary statistics - Provides a summary for each of the measures (i.e., CD, NRC, AS, AS_REL, descriptions above) from the "Raw data". Summary statistics include: original value, mean, maximum, minimum, standard deviation, coefficient of variation, p-values and confidence intervals (all labeled as rows).

Details

The `comspat()` function presents four measures from a family of Information Theory models developed by Juhász-Nagy (1967, 1976, 1984a, 1984b). The measures represent co-existence relationships in multispecies communities. For additional information on the measures please see the package vignette.

References

Bartha, S, Czárán, T & Podani, J. (1998). Exploring plant community dynamics in abstract coenostate spaces. Abstr. Bot. 22, 49–66.

Juhász-Nagy, P. (1967). On some 'characteristic area' of plant community stands. Proc. Colloq. Inf. Theor. 269–282.

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

Juhász-Nagy, P. (1984a). Notes on diversity. Part, I. Introduction. Abstr. Bot. 8: 43–55.

Juhász-Nagy, P. (1984b). Spatial dependence of plant populations. Part 2. A family of new models. Acta Bot. Acad Sci. Hung. 30: 363–402.

Tsakalos, J.L. et al. (2022). comspat: An R package to analyze within-community spatial organization using species combinations. Ecography. doi:10.1111/ecog.06216

See also

The display options of [`comspat_plot()`].

Author

James L. Tsakalos

Examples


data("grid_random", package = "comspat") #input data frame
data("param_grid", package = "comspat") #input parameter data frame
temp <- comspat(
  data = grid_random,
  params = param_grid[1:2, ],
  dim_max = 64,
  type = "Grid"
)