rarefy_otu | R Documentation |
Prepare data for rerafy curves.
rarefy_otu(phy, step = 10, rep = 3, measures = c("Observed", "Shannon"))
phy |
phyloseq |
step |
steps |
rep |
times of repetition |
measures |
(Optional). Default is |
rarefy table
library(phyloseq) data(its) phy <- phyloseq(otu_table(its, taxa_are_rows = TRUE)) rare <- rarefy_otu(phy) x_min <- group_by(rare, id) %>% summarise(across(Depth, max)) %>% .[, "Depth"] %>% min() ggplot(rare, aes(Depth, Observed, group = id, color = id)) + geom_vline(xintercept = x_min, linetype = "dashed", color = "grey60") + stat_summary(fun = "mean", geom = "smooth", size = .7) + stat_summary( fun.data = "mean_cl_normal", geom = "errorbar", size = .5, aes(width = max(Depth) / 30) ) + theme_bw2(15) + theme(legend.justification = c(1, 0), legend.position = c(1, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.