make_taxa_labels | R Documentation |
This function takes a table of taxonomic ranks, such as that stored in the
tax_table
slot of a phyloseq
object, and creates a label for each
taxon for use in plots and tables.
make_taxa_labels(taxtab)
taxtab |
A matrix or data frame, with taxa in rows and taxonoic ranks in columns. The last column should be “Species”, the first column should be kingdom or domain, and columns in between should progress in order of rank. |
Species labels that pass findnonmissing
are used, and
otherwise species are labeled “"sp."”. The lowest rank that passes
findnonmissing
is pasted before the species label.
A character vector containing the labels. If taxtab
has row names,
these are used to name the vector.
Lindsay V. Clark
tt <- matrix(c("Bacteria", "Firmicutes", "Clostridia", "Peptostreptococcales-Tissierellales", "Anaerovoracaceae", "Mogibacterium", "Unclassified", "Bacteria", "Firmicutes", "Clostridia", "Oscillospirales", "Ruminococcaceae", "Faecalibacterium", "prausnitzii", "Bacteria", "Firmicutes", "Clostridia", "Clostridia vadinBB60 group", "Unclassified", "Unclassified", "Unclassified"), nrow = 3, ncol = 7, byrow = TRUE, dimnames = list(c("db3b201de3a824d7356ce4d8360e5bc3", "615ce01e68e098adc445d06e072ba255", "6f643e7faeab3e737b38f5304b841d97"), c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"))) make_taxa_labels(tt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.