plot_density {microbiome} | R Documentation |
Plot abundance density across samples for a given taxon.
plot_density(x, variable = NULL, log10 = FALSE, adjust = 1, kernel = "gaussian", trim = FALSE, na.rm = FALSE, fill = "gray", tipping.point = NULL, xlim = NULL)
x |
|
variable |
OTU or metadata variable to visualize |
log10 |
Logical. Show log10 abundances or not. |
adjust |
see stat_density |
kernel |
see stat_density |
trim |
see stat_density |
na.rm |
see stat_density |
fill |
Fill color |
tipping.point |
Optional. Indicate critical point for abundance variations to be highlighted. |
xlim |
X axis limits |
A ggplot
plot object.
# Load gut microbiota data on 1006 western adults # (see help(atlas1006) for references and details) data(dietswap) # Use compositional abundances instead of absolute signal pseq.rel <- transform(dietswap, 'compositional') # Population density for Dialister spp.; with log10 on the abundance (X) # axis library(ggplot2) p <- plot_density(pseq.rel, variable='Dialister') + scale_x_log10()