format_OTU: Function to reformat OTU names for plotting.

Description Usage Arguments Value Examples

View source: R/format_OTU.R

Description

Italicize the taxonomical annotations and place the numerical identifier in brackets. By default, returns names formatted to work in conjunction with element_markdown. For example 'Dolosigranulum_pigrum_3' will be formatted into 'Dolosigranulum pigrum (3)' in the figure.

Usage

1
format_OTU(OTU_names, short = F, parse = F)

Arguments

OTU_names

vector of OTU-names in the form of <genus><species><numerical_id>, e.g. 'Dolosigranulum_pigrum_3'

short

whether or not the short name (dropping the species-name if available) should be returned (logical). Default: FALSE

parse

option to use in conjunction with geom_text_repel enabling italicized/formatted OTU names in for example ordination plots (logical). Default: FALSE

Value

returns a vector of properly formatted OTU names.

Examples

1
phyloseq::taxa_names(ps_NP)[1:10] %>% format_OTU()

wsteenhu/microbiomer documentation built on March 11, 2021, 6:05 p.m.