Description Usage Arguments Value Examples
View source: R/Price_FUNCTIONS.R
The Price equation generates a vector of values reflecting a comparison between two communities. This vector can be used to establish a distance between different pairs of communities, compared with the Price equation. Across all pairwise combinations of community pairs, this produces a distance matrix, which can be used to perform multivariate tests on Price analyses.
1 |
x |
A data frame, resulting from |
This function returns a list of two distance matrices:
dst5 |
A distance matrix calculated based on the full 5-part Price partition |
dst3 |
A distance matrix calculated based on the 3-part sCAFE version of the Price partition |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Data frame containing multiple communities we want to compare
set.seed(36)
cms<-data.frame(comm.id=sort(rep(seq(1,3),6)),
species=rep(LETTERS[seq(1,6)],3),
func=rpois(6*3,lambda = 2))
#Identify a grouping columns
cms<-group_by(cms,comm.id)
# Perform pairwise comparisons of all communities in cms identified by comm.id
pp<-pairwise.price(cms,species='species',func='func')
dm<-get.dist.mats(pp)
dm
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.