Learn R Programming

otuSummary (version 0.1.2)

calc_bc: calculate the Bray-Curtis dissimilarity

Description

This function will calculate the Bray-Curtis distance matrix for community data.

Usage

calc_bc(df)

Value

The function returns lower triangular distrance matrix.

Arguments

df

data frame or matrix, i.e. OTU or ASV table with sites in rows and species in columns.

Author

Sizhong Yang <yanglzu@163.com>

Details

This function will calculate the dissimilarity and output as lower triangular distance matrix.

Examples

Run this code
data(otuqiime)
mat <- calc_bc(t(otuqiime[,-ncol(otuqiime)]))
mat2 <- as.matrix(mat)
dim(mat2)

Run the code above in your browser using DataLab