Learn R Programming

paleoMAS (version 2.0-1)

change: Dissimilarities, distances and rates of change

Description

This function calculates dissimilarity or distances between contiguous samples (timeslices), as well as rates of ecological change when a robust age model is available.

Usage

change(x, age, dca = FALSE, meth = "euclidean", bin = FALSE, roc = FALSE, digits = 1)

Arguments

x
A matrix with samples in rows and species in columns.
age
Vector with sample ages.
dca
Logical indicating whether or not detrended correspondece analysis scores (DCA, performed according to decorana package vegan) will be used as a basis for dissimilarity computation. If dca=TRUE the dissimilarity between samples is calculated as euclidean distance between the first four DCA axis scores. If FALSE dissimilarity is calculated according to the methods specified in meth).
meth
Corresponds to methods available in vegdist of vegan. Available methods are "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "morisita", "horn", "mountford", "raup" , "binomial" or "chao". See vegdist (package vegan) for details.
bin
Argument of the function vegdist (package vegan) that standardizes the data into presence/absence before calculating the dissimilarity.
roc
Logical argument of whether or not the calculation of rates of change is desired.
digits
Number that specifies the digits desired for the rounded-up ages.

Value

Returns a matrix with ages and their corresponding dissimilarity, distances or RoC. As calculations between subsequent samples return n-1 observations, the distance, dissimilarity, or RoC are assigned to the youngest of the two contiguous samples. When roc=TRUE, it also returns a vector res with time steps between samples.

Details

Rates of change are calculated as: RoC[jk] = vegdist[jk]/"res"). For further discussion on assumptions involved, see Urrego et al (2009). DCA is calculated according to decorana (package vegan.)

References

Urrego DH, Bush M, Silman MR, Correa-Metrio A, Ledru M-P, Mayle FE, Valencia BG (2009). Millennial-scale ecological changes in tropical South America since the Last Glacial Maximum. Past climate variability from the Last Glacial Maximum to the Holocene in South America and surrounding regions. (eds. Vimeux F, Sylvestre F, Khodri M). Springer.

See Also

See vegdist and decorana for details on dissimilarity indexes.

Examples

Run this code
data(quexilchron,quexildepths,quexilper)
ages<-chron(quexilchron,quexildepths,max.depth=1957)$chronology[,2]
#Absolute change
change(quexilper,ages,meth="bray")
change(quexilper,ages,dca=TRUE)
#Rate of change
change(quexilper,ages,meth="bray",roc=TRUE)
change(quexilper,ages,dca=TRUE,roc=TRUE)

Run the code above in your browser using DataLab