plot_alpha_diversity: plot_alpha_diversity

Description Usage Arguments Examples

View source: R/plot_alpha_diversity.R

Description

This is a function for plotting alpha diversity. Alpha diversity can only accept intergers (counts) OTU table!

Usage

1
2
3
plot_alpha_diversity(phyloseq, feature, feature2 = NA,
  feature2_shape = c(0:21), measures = NA, p_test = FALSE,
  colors = NULL, dotsize = 1)

Arguments

phyloseq

A phyloseq object contain otu table, taxonomy table, sample metadata and phylogenetic tree. OTU table of the phyloseq can only contain intergers (counts) !

feature

The column name of the feature you want to select from metadata.

feature2

The column name of another feature you want to select from metadata, e.g. "Gender", which will make the plots draw in different shapes. Default is NA.

feature2_shape

The shape values for feature2. See ggplot2::scale_shape_manual.

measures

The measures to calculate alpha diversity. Default is NA. If NA, all available alpha diversity measures will be calculated and generate a table. If not NA, measures should be one of c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson", "Fisher").

p_test

The p-value to test alpha diversity. Default is FALSE, will not calculate p-value. p_test should be either "wilcox" or "kruskal". PS: "wilcox" can only work with two groups.

colors

A vector of colors. The number of colors should be larger than the number of feature. Default is NULL, if NULL, plot_alpha_diversity will use ggsci::jco theme for the plot.

dotsize

See geom_dotplot(dotsize). Default is 1.

Examples

1
2
plot_alpha_diversity(demo_phyloseq_object, feature = "diagnosis", feature2 = NA, measures = "Chao1",
p_test = "kruskal")

yeguanhuav/visual16S documentation built on Aug. 11, 2019, 8:51 a.m.