taxonTree: Create a 'data.tree' Object from Taxon Names

View source: R/taxonTree.R

taxonTreeR Documentation

Create a data.tree Object from Taxon Names

Description

This function takes one or more taxon names and taxonomic levels as input.

Usage

taxonTree(
  taxon,
  level = c("order", "suborder", "greatgroup", "subgroup"),
  root = "Soil Taxonomy",
  verbose = TRUE,
  special.chars = c("|--", "|", "|", "-"),
  file = "",
  ...
)

Arguments

taxon

A vector of taxon names

level

One or more of: "order", "suborder", "greatgroup", "subgroup". The lowest level is passed to getChildLevel() to generate the leaf nodes.

root

Label for root node. Default: "Soil Taxonomy"; NULL for "unrooted" tree.

verbose

Print tree output? Default: TRUE

special.chars

Characters used to print the tree to console. Default: c("|--", "|", "|", "-"). For fancy markup try: c("\u251c","\u2502", "\u2514", "\u2500 ")

file

Optional: path to output file. Default: "" prints to standard output connection (unless redirected by sink())

...

Additional arguments to data.tree::as.Node.data.frame()

Details

A subclass of data.tree Node object is returned. This object has a custom print() method

Value

A SoilTaxonNode (subclass of data.tree Node) object (invisibly). A text representation of the tree is printed to stdout when verbose=TRUE.

Examples




# hapludults and hapludalfs (to subgroup level)
taxonTree(c("hapludults", "hapludalfs"))

# alfisols suborders and great groups
taxonTree("alfisols", root = "Alfisols", level = c("suborder", "greatgroup"))

SoilTaxonomy documentation built on Nov. 17, 2023, 1:07 a.m.