beta_heatmap: Create heatmaps of the supplied dissimilarity matrices

Description Usage Arguments Value Examples

View source: R/beta_heatmap.R

Description

Create heatmaps of the supplied dissimilarity matrices ordered by supplied grouping variables

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
beta_heatmap(
  beta_div,
  micro_set,
  ...,
  low_grad,
  high_grad,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  subtitle = NULL,
  natural_order = TRUE,
  legend_title = "Dissimilarity"
)

Arguments

beta_div

A dissimilarity matrix calculated by beta_div

micro_set

A tidy_micro data set

...

Variables for ordering

low_grad

Colors for the corelation magnitude. Will be fed into scale_fill_gradient

high_grad

Colors for the corelation magnitude. Will be fed into scale_fill_gradient

main

Plot title

xlab

x-axis label

ylab

y-axis label

subtitle

Plot label

natural_order

Keep order of axes in the conventional order for dissimilarity matrices

legend_title

Title for the legend

Value

Returns a ggplot that you can add geoms to if you'd like

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)

otu_tabs <- list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)
set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including the first week

## Bray-Curtis beta diversity
bray <- set %>% beta_div(table = "Family")

bray %>% beta_heatmap(micro_set = set, bpd1)

CharlieCarpenter/tidyMicro documentation built on April 25, 2021, 4:09 p.m.