View source: R/phy_summarise_taxa_by_metadata.R
phy_summarise_taxa_by_metadata | R Documentation |
A quick dplyr function that allows to summarise (mean, median, sum, ...) all taxa for each category of a metadata column. So far tested only on discrete variables.
phy_summarise_taxa_by_metadata(physeq, metadata_var, .fun = mean)
physeq |
A |
metadata_var |
A |
.fun |
a |
A matrix
object with the metadata variable in columns, and taxa in rows
data(enterotype)
matrix_for_plot <- phy_summarise_taxa_by_metadata(microbiome::transform(enterotype, "clr"), metadata_var = "Enterotype", .fun = mean)
pheatmap::pheatmap(matrix_for_plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.