get.dist.mats: Calculate Price component based distance matrix between...

Description Usage Arguments Value Examples

View source: R/Price_FUNCTIONS.R

Description

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.

Usage

1

Arguments

x

A data frame, resulting from pairwise.price

Value

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

Examples

 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

ctkremer/priceTools documentation built on May 28, 2019, 7:49 p.m.