plot_heat: Heatmaps for Taxonomic Group of Interest

View source: R/plot_heat.R

plot_heatR Documentation

Heatmaps for Taxonomic Group of Interest

Description

The plot_heat() function will create heatmaps visualizing the relative abundance of a taxonomic group of interest from a data.frame.

Usage

plot_heat(x, taxlevel, taxaname, xvar, yvar, fillvar)

Arguments

x

is a data.frame from phyloseq_to_df().

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.

Value

A ggplot object.

Examples

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")


escamero/mirlyn documentation built on Aug. 6, 2023, 9:30 p.m.