calc_beta2: Beta diversity analysis, generating beta2-class (two-factor)

View source: R/calc_beta2.R

calc_beta2R Documentation

Beta diversity analysis, generating beta2-class (two-factor)

Description

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

Usage

calc_beta2(data, type, .group1, .group2, method, ...)

Arguments

data

An easynem-class data.

type

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

.group1

Treatment factors 1 that need to be compared.

.group2

Treatment factors 2 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_beta2(pca, con_crop, season, method = "bray")

Value

A beta2-class for storing beta diversity analysis results.

See Also

Other functions in this R package for data calculations: calc_beta, 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_nem(tab = easynem_example("nemtab1.csv"),
                tax = easynem_example("nemtax1.csv"),
                meta = easynem_example("nemmeta1.csv"))
nem_pcoa <- nem |> calc_beta2(pcoa, con_crop, season, method = "bray")
show(nem_pcoa)
nem_nmds <- nem |> calc_beta2(nmds, con_crop, season, method = "bray")
show(nem_nmds)

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