beta_div: Beta Diversity Calculations for tidy_micro

Description Usage Arguments Value References Examples

View source: R/Beta_Divs.R

Description

Calculate beta diversities of your tidy_micro set. This function reformats the data into the original OTU table and then feeds that into the vegdist function

Usage

1
beta_div(micro_set, table, method = "bray")

Arguments

micro_set

A tidy_micro data set

table

Table you'd like to use when calculating alpha diversity. Your lowest level is recommended

method

A dissimilarity method compatible with vegdist

Value

A symmetrix distance matrix

References

help(vegdist)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(phy); data(cla); data(ord); data(fam); data(met)

otu_tabs = list(Phylum = phy, Class = cla, Order = ord, Family = fam)
set <- tidy_micro(otu_tabs = otu_tabs, meta = met) %>%
filter(day == 7) ## Only including the first week

## Bray-Curtis beta diversity
bray <- set %>% beta_div(table = "Family")

## Morisita-Horn beta diversity
horn <- set %>% beta_div(table = "Family", method = "horn")

CharlieCarpenter/tidy.micro documentation built on Jan. 19, 2020, 6:28 p.m.