collapse_heatmap: Collapse a heatmap if the x and y-axes include subgroups

Description Usage Arguments Details

Description

If the factor defined on the x-axis is a sample but there are actually replicates for each sample, then defining the plot with aes(x=sample) and then collapse_heatmap yields the mean of each replicate.

Usage

1
collapse_heatmap(p, collapse_fn = mean, ...)

Arguments

p

a ggplot heatmap with x, y, and fill aesthetics defined

collapse_fn

the function to use to combine all the inner values

...

additional arguments to collapse_fn

Details

Similarly, for the y-axis, if you're interested in higher-order taxa, set aes(y=Genus) or similar and then collapse_heatmap to yield the mean abundance for that taxa.

If both axes contain subgroups, this averages over all of them.


eclarke/heatmappr documentation built on May 15, 2019, 7:54 p.m.