plot_beta_diversity: plot_beta_diversity

Description Usage Arguments Examples

View source: R/plot_beta_diversity.R

Description

This is a function for plotting beta diversity.

Usage

1
2
plot_beta_diversity(phyloseq, feature, feature2 = NA,
  feature2_shape = c(0:21), method = "bray", colors = NULL, size = 3)

Arguments

phyloseq

A phyloseq object contain otu table, taxonomy table, sample metadata and phylogenetic tree.

feature

The column name of the feature you want to select from metadata, e.g. "Phenotype".

feature2

The column name of another feature you want to select from metadata, which will show in different shape, e.g. "Gender". Default is NA.

feature2_shape

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

method

The method to calculate beta diversity. Method should be one of c("bray", "jaccard", "unifrac", "wunifrac"). Default is "bray". PS: "unifrac" and "wunifrac" require a phylogenetic tree.

colors

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

size

Value for geom_point(size). Default is 3.

Examples

1
plot_beta_diversity(demo_phyloseq_object, feature = "diagnosis")

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