twinsform: Transform Data for Correspondence Analysis like twinspan

twinsformR Documentation

Transform Data for Correspondence Analysis like twinspan

Description

Function transforms data so that Correspondence Analysis gives the same result as in twinspan divisions.

Usage

twinsform(x, cutlevels = c(0, 2, 5, 10, 20), subset, downweight = TRUE)

Arguments

x

Input (community) data.

cutlevels

Cut levels used to split quantitative data into binary pseudospecies.

subset

Logical vector or indices that select a subset of quadrats (sampling units).

downweight

Downweight result similarly as in decorana. Downweighting is needed to replicate the process in twinspan, but it can be left out when we only want to have a stacked data set for other uses.

Details

In twinspan, quantitative species data are split into binary (0/1) pseudospecies by cutlevels. All these pseudospecies are stacked as columns in a new data set. Rare pseudospecies that occur at lower frequency than 0.2 are downweighted within twinspan. This reduces the weight of rare species or rare abundance levels in correspondence analysis, but downweighting is optional in this function.

When the downweighted data are analysed with correspondence analysis (e.g., cca, decorana with option ira=1), these will give the same first eigenvalue and ordination as in twinspan. When a subset of a twinspan class is used, correspondence analysis of subdivision of the class can be obtained.

Value

A stacked matrix of optionally downweighted pseudospecies.

See Also

downweight in vegan: this function is often used with Detrended Correspondence Analysis (decorana). However, the implementation is slightly different in TWINSPAN, and weights differ slightly. Function twin2stack extracts similar data from a twinspan result object.

Examples


data(ahti)
tahti <- twinsform(ahti)
colnames(tahti)
## needs vegan for correspondence analysis
if (suppressPackageStartupMessages(require("vegan"))) {
decorana(tahti, ira=1)
}
## similar first eigenvalue
eigenvals(twinspan(ahti))


jarioksa/twinspan documentation built on Nov. 23, 2024, 2:49 p.m.