calc_beta: Beta diversity analysis, generating beta-class (single...

View source: R/calc_beta.R

calc_betaR Documentation

Beta diversity analysis, generating beta-class (single factor)

Description

The calc_beta() is used to perform beta diversity analysis and create beta-class. This function is only applicable to single factor analysis, see calc_beta2 for a two-factor version of the function.

Usage

calc_beta(data, type, .group, method, ...)

Arguments

data

An easynem-class data.

type

Types of beta diversity analysis (pca, pcoa or nmds).

.group

Treatment factors that need to be compared.

method

Dissimilarity index, partial match to "manhattan", "euclidean", "canberra", "clark", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao", "mahalanobis", "chisq", "chord", "hellinger", "aitchison", or "robust.aitchison". See vegdist.

...

Other parameters for cmdscale, vegdist and adonis2.

Details

To facilitate code interpretation, it is recommended to use the pipe symbol |> to connect functions:

nem_pca <- nem |> calc_beta(pca, Treatments, method = "bray")

Value

A beta-class for storing beta diversity analysis results.

See Also

Other functions in this R package for data calculations: calc_beta2, calc_compare, calc_compare2, calc_alpha, calc_nemindex, calc_funguild, calc_funguild2, calc_mf, calc_mf2, calc_ter, calc_ter2, calc_ef, calc_ef2.

Examples

nem <- read_nem2(tab = nemtab, tax = nemtax, meta = nemmeta)
nem_pcoa <- nem |> calc_beta(pcoa, Treatments, method = "bray")
show(nem_pcoa)
nem_nmds <- nem |> calc_beta(nmds, Treatments, method = "bray")
show(nem_nmds)

easynem documentation built on Nov. 5, 2025, 7:39 p.m.