View source: R/metricsBioTIME.R
getBetaMetrics | R Documentation |
Calculates a set of standard beta diversity metrics
getBetaMetrics(x, measure)
x |
( |
measure |
( |
The function getBetaMetrics computes three beta diversity metrics for a given community data frame, where measure
is a character input specifying the abundance or biomass field used for the calculations. getBetaMetrics
calls the vegdist
function which calculates for each row the following metrics: Jaccard dissimilarity (method = "jaccard"
), Morisita-Horn dissimilarity (method = "horn"
) and Bray-Curtis dissimilarity (method = "bray"
). Here, the dissimilarity metrics are calculated against the baseline year of each assemblage time series i.e.
the first year of each time series.
Note that the input data frame needs to be in the format of the output of the
gridding
and/or resampling
functions, which includes keeping the default BioTIME data column names. If such columns are not found an error is
issued and the computations are halted.
Returns a data.frame
with results for Jaccard dissimilarity (JaccardDiss
), Morisita-Horn dissimilarity (MorisitaHornDiss
), and Bray-Curtis dissimilarity (BrayCurtsDiss
) for each year and assemblageID
.
x <- data.frame(
resamp = 1L,
YEAR = rep(rep(2010:2015, each = 4), times = 4),
Species = c(replicate(
n = 8L,
sample(letters, 24L, replace = FALSE))),
ABUNDANCE = rpois(24 * 8, 10),
assemblageID = rep(LETTERS[1L:8L], each = 24)
)
res <- getBetaMetrics(x, measure = "ABUNDANCE")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.