tables: Constancy and Contingency Tables

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Method constancy lists for each species the fraction (percentage) of samples in each partition (or the whole data set) the species occurs contingency lists just the number of occurrences. The latter is based on presence/absence of a species (layer-replicate), whereas method average divides the sum of species abundances by the number of plots in which it occurs. A tabulation of partitioning(obj) against a cross-classifying factor can be obtained with the as.table method. The grouping is taken from a data column of sites(obj).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'Vegsoup'
constancy(obj, percentage = TRUE, ...)

## S4 method for signature 'VegsoupPartition'
constancy(obj, percentage = TRUE, ...)

## S4 method for signature 'Vegsoup'
contingency(obj, ...)

## S4 method for signature 'VegsoupPartition'
contingency(obj, ...)

## S4 method for signature 'VegsoupPartition'
average(obj, ...)

## S4 method for signature 'VegsoupPartition'
as.table(x, ...)

Arguments

obj, x

Vegsoup or VegsoupPartition object.

percentage

numeric. Return results of constancy as percentages.

...

additional arguments passed to methods. For contingency and average ... expands to arguments passed to matrix methods as.logical and as.matrix respectively (see ‘Details’). Additional arguments to constancy are passed to round (the digits argument) and are only applicable if percentage = TRUE. For as.table ... expands to a character giving a column name of sites(x) or a vector which can be interpreted as factor.

Details

An importance table as returned by method average lists for each species the average (mean) abundance of each species (stratum-replicate) in each partition. Sensible results are only to be obtained if the object has either a semi-quantitative or quantitative cover scale defined (check is.ordinal(obj)). Note, if only presence/absence data is available average returns the same results as [...], which bears no information as the summed abundance is just the number of occurrences. See method quantile for descriptive summaries of species abundances in partitions.

Specifying mode = "R" in contingency and average allows for a kind of R-mode analysis where the grouping is defined by strata (layers). Note, this rarely makes sense if there is only one layer. For multi layer (stratum) objects (length(layers(obj)) > 1) a call to average in R-mode implies that all species abundances in a layer are summed up and divided by layer contingencies (contingency(obj, mode = "R")), in this case the number of species is found in a respective layer for each plot.

Value

For constancy, contingency, and average a object of class 'matrix' with as many columns as there are partitions (strata if mode = "R") and as many rows as species (respectively plots). If mode is not specified, strata-replicates are treated separately.

For as.table an object of class 'table' with the levels of the cross-classifying factor in rows.

Author(s)

Roland Kaiser

See Also

const and importance in labdsv, quantile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(barmstein)
x <- VegsoupPartition(barmstein, k = 2)

# constancy table for two partitions
head(constancy(x, digits = 1))

# equivalent
head(round(contingency(x) / as.vector(table(partitioning(x))) * 100, digits = 1))

# R-mode analysis
# remove presence/absence standardisation
decostand(x) <- NULL
contingency(x, mode = "R")
average(x, mode = "R")

# tabulate partitioning vector againts sites column
as.table(x, "expo")

# tabulate partitiong vector againts other vector
y <- rownames(subset(x, "Achnatherum")) # plot names with this species
y <- y == rownames(x)                   # TRUE where the species occurs

as.table(x, y)

vegsoup documentation built on Feb. 24, 2021, 3 a.m.