distTraitspace: Calculate the distances

Description Usage Arguments Value References See Also Examples

Description

Calculates the distances between the predicted and true/observed relative abundances (by default) or species distributions if byrow = FALSE.

Usage

1
distTraitspace(result, obs = NULL, byrow = TRUE)

Arguments

result

The output from the traitspace function (class traitspace)

obs

The observed matrix - where, each row corresponds to a site and each column to a species - the order of sites and species should match with the order in which they appear in the predicted matrix. By default, NULL, will generate the observed matrix using the supplied trait data using the trueP function. See the trueP function for details.

byrow

By default, TRUE, will compare the relative abundances. If FALSE, will compare the species distribution.

Value

A list of distances calculated using the following measures: Euclidean, Manhatten, Hellinger, Kullback-Leibler and Bhattacharya. It calculates both the average distance (averages across all sites or species) as well as individual distances.

References

Basu, A., Shioya, H., & Park, C. (2011). Statistical inference: the minimum distance approach. CRC Press.

See Also

pval, Traitspace, TraitspaceMod, trueP

Examples

1
2
3
4
5
6
7
data(spdata)
species<-spdata$species  #species column
trt<-cbind(spdata$t1,spdata$t2) #two traits
env<-spdata$env     #one env gradient
site<-spdata$site   #site information
result1<-Traitspace(species, trt, env, site)
distTraitspace(result1)

Traitspace documentation built on May 2, 2019, 4:10 a.m.