Description Usage Arguments Value Examples
pull_lev
is designed to work with Taxa names that contain multiple taxonomy levels. The function splits Taxa names using str_split
, then grabs the string in position l
or higher. If nothing exists at or past position l
, the function will add "Unclassified" to the last position. The function skips over any Taxa named "Other".
1 | pull_lev(Taxa, l, sep = "/")
|
Taxa |
Taxa names with taxonomic rank separated by some character |
l |
Numeric. Position / taxonomic rank. Best if it is the highest rank in Taxa names |
sep |
Character to split |
A character string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(bpd_fam); data(bpd_clin)
set <- tidy_micro(otu_tabs = bpd_fam, clinical = bpd_clin, tab_names = "Family",
prev_cutoff = 5, ra_cutoff = 1, exclude_taxa = "Bacteria",
count_summary = FALSE, filter_summary = FALSE) %>%
filter(day == 7)
## Taxa names
pull_lev(unique(set$Taxa), 4)
## Most useful to clean up plots ##
# Hard to read!
(ch <- cor_heatmap(set, table = "Family", weight, gestational_age))
# Much better
ch$data$Taxa <- pull_lev(ch$data$Taxa,4)
ch
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.