Description Usage Arguments Details Value Examples
View source: R/micro_heatmap.R
A function to create heatmaps of estimated beta coeffients from each model fit by nb_mods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
modsum |
The output from nb_mods |
low_grad |
The low gradient colors for the coefficient magnitude. Will be fed into scale_fill_gradient |
high_grad |
The high gradient colors for the coefficient magnitude. Will be fed into scale_fill_gradient |
mid_grad |
The medium gradient colors for the coefficient magnitude. Will be fed into scale_fill_gradient |
midpoint |
Midpoint for coefficient magnitude in legend |
top_taxa |
Only plot X taxa with the largest magnitude beta coefficients |
low_lim |
Lower limits of the fill gradient. Will default to the largest magnitude effect size |
high_lim |
Upper limits of the fill gradient. Will default to the largest magnitude effect size |
mute_cols |
Mute the colors of the fill gradients |
alpha |
Mark beta coefficient cells with p-values below this cutoff |
dot_size |
size of marker in cells |
dot_shape |
shape of marker in cells |
main |
Plot title |
xlab |
x-axis label |
ylab |
y-axis label |
subtitle |
Plot label |
xaxis |
Labels for the x-axis ticks |
legend_title |
Title of figure legend |
caption |
plot caption to be displayed at the bottom of plot |
The output will give gray columns if there are missing values in the supplied continuous variable
Returns a ggplot that you can add geoms to if you'd like
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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
## Creating negative binomial models on filtered tidy_micro set
nb_fam <- set %>%
mutate(bpd1 = factor(bpd1)) %>% ## making bpd1 a factor
otu_filter(ra_cutoff = 0.1, exclude_taxa = c("Unclassified", "Bacteria")) %>%
nb_mods(table = "Family", bpd1)
nb_fam %>% micro_heatmap
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.