plot_heat | R Documentation |
The plot_heat()
function will create heatmaps visualizing the relative abundance of
a taxonomic group of interest from a data.frame
.
plot_heat(x, taxlevel, taxaname, xvar, yvar, fillvar)
x |
is a |
taxlevel |
is the taxonomic level of the taxa you're interested in. By default, it will look at the phylum level. |
taxaname |
is the taxonomic name of interest. |
xvar |
is a categorical variable selected from the metadata. |
yvar |
is a secondary categorical variable selected from the metadata. |
fillvar |
is the column name of the abundance. |
A ggplot
object.
library(mirlyn)
library(dplyr)
data(example)
example_df <- phyloseq_to_df(example)
example_df_phylum <- example_df %>%
group_by(sample, Id, Phylum) %>%
summarise(abundance = sum(abundance))%>%
mutate(Proportion = abundance/sum(abundance)*100)
plot_heat(example_df_phylum, taxlevel = "Phylum",taxaname = "Cyanobacteria",
xvar = "sample", yvar = "Id", fillvar = "Proportion")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.