Learn R Programming

rbiom (version 2.2.0)

rare_stacked: Visualize the number of observations per sample.

Description

Visualize the number of observations per sample.

Usage

rare_stacked(
  biom,
  rline = TRUE,
  counts = TRUE,
  labels = TRUE,
  y.transform = "log10",
  ...
)

Value

A ggplot2 plot. The computed data points and ggplot command are available as $data and $code, respectively.

Arguments

biom

An rbiom object, such as from as_rbiom(). Any value accepted by as_rbiom() can also be given here.

rline

Where to draw a horizontal line on the plot, intended to show a particular rarefaction depth. Set to TRUE to show an auto-selected rarefaction depth, FALSE to not show a line, or an integer for a custom position. Default: TRUE.

counts

Display the number of samples and reads remaining after rarefying to rline reads per sample. Default: TRUE.

labels

Show sample names under each bar. Default: TRUE.

y.transform

Y-axis transformation. Options are "log10" or "none". Default: "log10". Use xaxis.transform or yaxis.transform to pass custom values directly to ggplot2's scale_* functions.

...

Additional parameters to pass along to ggplot2 functions. Prefix a parameter name with r. to ensure it gets passed to (and only to) geom_hline. For instance, r.color = "black" ensures only the horizontal rarefaction line has its color set to "black".

See Also

Other rarefaction: rare_corrplot(), rare_multiplot(), rarefy(), rarefy_cols(), sample_sums()

Other visualization: adiv_boxplot(), adiv_corrplot(), bdiv_boxplot(), bdiv_corrplot(), bdiv_heatmap(), bdiv_ord_plot(), plot_heatmap(), rare_corrplot(), rare_multiplot(), stats_boxplot(), stats_corrplot(), taxa_boxplot(), taxa_corrplot(), taxa_heatmap(), taxa_stacked()

Examples

Run this code
    library(rbiom) 
    
    rare_stacked(hmp50)
    
    rare_stacked(hmp50, rline = 500, r.linewidth = 2, r.linetype = "twodash")
    
    fig <- rare_stacked(hmp50, counts = FALSE)
    fig$code
    

Run the code above in your browser using DataLab