View source: R/plot_functions.R
| ridges_sam_pq | R Documentation |
Graphical representation of distribution of samples across taxa using ridges.
This is the sample-centric counterpart of ridges_pq(): each ridge
represents a taxon (at tax_level) and the x-axis shows the abundance
distribution across samples, optionally colored by a sample factor.
ridges_sam_pq(
physeq,
fact,
nb_seq = TRUE,
log10trans = TRUE,
tax_level = "Class",
type = "density",
...
)
physeq |
(required) a |
fact |
(required) Name of the factor in |
nb_seq |
(logical; default TRUE) If set to FALSE, only the number of
samples is counted. Concretely, physeq |
log10trans |
(logical, default TRUE) If TRUE, the abundance is log10 transformed. |
tax_level |
The taxonomic level used for grouping taxa on the y-axis |
type |
Either "density" (the default) or "ecdf" to plot a
cumulative version using |
... |
Other params passed on to |
A ggplot2 plot with ridges representing the
distribution of samples for each taxon
Adrien Taudière
if (requireNamespace("ggridges")) {
ridges_sam_pq(data_fungi_mini, "Height",
alpha = 0.5,
log10trans = FALSE, tax_level = "Genus"
) +
xlim(c(0, 1000))
}
if (requireNamespace("ggridges")) {
ridges_sam_pq(data_fungi_mini, "Height", alpha = 0.5, scale = 0.9)
ridges_sam_pq(data_fungi_mini, "Height",
alpha = 0.5, scale = 0.9,
type = "ecdf"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.