Description Usage Arguments Value Author(s) Examples

View source: R/cor_rocky_mtn.R

Calculate the correlation between the relative abundance of each taxa within a specified table and a continuous variable of interest. Correlation is calculated by `cor`

. By default, Kendall's correlation is used to account for the prevalence of ties that often occur (lots of 0s)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |

`micro_set` |
A tidy_micro data set |

`table` |
OTU table of interest |

`x` |
Continuous variable of interest |

`y` |
The taxa information. The centered log ratio (clr) is recommended. |

`method` |
Correlation type; must be supported by |

`main` |
Plot title |

`xlab` |
Lable for x-axis |

`ylab` |
Label for y-axis |

`subtitle` |
Plot subtitle |

`cut_lines` |
Add lines for p-value cutoffs |

`line_text` |
Label p-value cut-offs |

`sig_text` |
Label taxa with correlations greater than |

`lwd` |
line width for cut_lines |

`cor_label` |
Cutoff for correlations to be labeled |

`breaks` |
Where to place cut_lines along y-axis |

A ggplot you can add geoms to if you'd like

Charlie Carpenter, Dan Frank

1 2 3 4 5 6 7 8 | ```
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
set %>% cor_rocky_mtn(table = "Family", weight, cor_label = 0.3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.