makeNewick {taxonomizr}R Documentation

Create a Newick tree from taxonomy

Description

Create a Newick formatted tree from a data.frame of taxonomic assignments

Usage

makeNewick(
  taxa,
  naSub = "_",
  excludeTerminalNAs = FALSE,
  quote = NULL,
  terminator = ";"
)

Arguments

taxa

a matrix with a row for each leaf of the tree and a column for each taxonomic classification e.g. the output from getTaxonomy

naSub

a character string to substitute in place of NAs in the taxonomy

excludeTerminalNAs

If TRUE then do not output nodes downstream of the last named taxonomic level in a row

quote

If not NULL then wrap all entries with this character

terminator

If not NULL then add this character to the end of the tree

Value

a string giving a Newick formatted tree

See Also

getTaxonomy

Examples

taxa<-matrix(c('A','A','A','B','B','C','D','D','E','F','G','H'),nrow=3)
makeNewick(taxa)
taxa<-matrix(c('A','A','A','B',NA,'C','D','D',NA,'F','G',NA),nrow=3)
makeNewick(taxa)
makeNewick(taxa,excludeTerminalNAs=TRUE)
makeNewick(taxa,quote="'")

[Package taxonomizr version 0.10.6 Index]