Barplot based on ggplot2
plot_barplot(
object,
fill = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
alluvial = FALSE,
top_n = 5,
show.legend,
what = c("sum_intensity", "mean_intensity", "median_intensity"),
na.rm = TRUE,
relative = TRUE,
re_calculate_relative = FALSE,
x = "sample_id",
color = "balck",
facet_grid,
...
)
# S3 method for microbiome_dataset
plot_barplot(
object,
fill = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
alluvial = FALSE,
top_n = 5,
show.legend,
what = c("sum_intensity", "mean_intensity", "median_intensity"),
na.rm = TRUE,
relative = TRUE,
re_calculate_relative = FALSE,
x = "sample_id",
color = "balck",
facet_grid,
...
)
microbiome_dataset
fill for barplot
Add alluvial or not.
default is 5
show.legend or not
which you want to mutate
na.rm
relative intensity or not.
re-calculate relative abundance or not.
x axis
color for barplot
facet_grid
other params
ggplot2 class object
library(microbiomeplot)
data("global_patterns")
global_patterns %>%
activate_microbiome_dataset(what = "sample_info") %>%
filter(SampleType %in% c("Feces", "Mock")) %>%
plot_barplot(fill = "Phylum")
global_patterns %>%
activate_microbiome_dataset(what = "sample_info") %>%
filter(SampleType %in% c("Feces", "Mock")) %>%
plot_barplot(
fill = "Phylum",
relative = TRUE,
re_calculate_relative = TRUE,
show.legend = TRUE
)
global_patterns %>%
activate_microbiome_dataset(what = "sample_info") %>%
filter(SampleType %in% c("Feces", "Mock")) %>%
plot_barplot(fill = "Phylum",
alluvial = TRUE,
top_n = 10)
global_patterns %>%
activate_microbiome_dataset(what = "sample_info") %>%
filter(SampleType %in% c("Feces", "Mock")) %>%
plot_barplot(
fill = "Phylum",
relative = TRUE,
re_calculate_relative = TRUE,
show.legend = TRUE,
alluvial = TRUE,
top_n = 10
)
global_patterns %>%
activate_microbiome_dataset(what = "sample_info") %>%
filter(SampleType %in% c("Feces", "Mock")) %>%
plot_barplot(
fill = "Phylum",
relative = TRUE,
re_calculate_relative = TRUE,
show.legend = TRUE,
alluvial = TRUE,
top_n = 10,
facet_grid = "SampleType"
)