cleanPhylo: Clean a phylogeny for single-tip-per-species analyses

View source: R/cleanPhylo.R

cleanPhyloR Documentation

Clean a phylogeny for single-tip-per-species analyses

Description

Clean a phylogeny for single-tip-per-species analyses

Usage

cleanPhylo(
  tr,
  delim = "|",
  tipElem = 1,
  uniquesOnly = TRUE,
  strFixed = TRUE,
  gsubFromTo = c("_", " "),
  gsubFixed = TRUE,
  trimWhiteSpace = TRUE
)

Arguments

tr

A phylo object

delim

Character delimiting species names from other info

tipElem

Integer indicating which element of the tip name contains the species

uniquesOnly

Boolean: retain only unique tip labels? Generally this is what you want

strFixed

Boolean: use fixed = TRUE in strsplit?

gsubFromTo

Character, length = 2; or NA: if character, use with gsub to clean tip labels

gsubFixed

Boolean: use fixed = TRUE in gsub?

trimWhiteSpace

Boolean: trim leading and trailing whitespace?

Examples

data(malus_tr)
data(quercus_tr)
data(tilia_tr)
data(ulmus_tr)
malus2 <- cleanPhylo(malus, delim = '_|_')
quercus2 <- cleanPhylo(quercus)
tilia2 <- cleanPhylo(tilia)
ulmus2 <- ulmus
ulmus2$tip.label <- paste('Ulmus', ulmus2$tip.label)

andrew-hipp/edivColl documentation built on Jan. 29, 2023, 11:40 a.m.