setTxnyms: Set the txnym slots in a tree

Description Usage Arguments Details See Also Examples

View source: R/set-methods.R

Description

Return a tree with txnyms added to specified nodes

Usage

1
setTxnyms(tree, txnyms)

Arguments

tree

TreeMan object

txnyms

named vector or list

Details

Returns a tree. Specify the taxonomic groups for nodes in a tree by providing a vector or list named by node IDs. Takes output from searchTxnyms. Only letters, numbers and underscores allowed. To remove special characters use regular expressions, e.g. gsub(['a-zA-Z0-9_'], '', txnym)

See Also

taxaResolve, searchTxnyms, getNdsLng, getNdLng, https://github.com/DomBennett/treeman/wiki/set-methods

Examples

1
2
3
4
5
6
7
8
9
library(treeman)
data(mammals)
# let's change the txnym for humans
# what's its summary before we change anything?
summary(mammals[['Homo_sapiens']])
# now let's add Hominini
new_txnym <- list('Homo_sapiens'=c('Hominini', 'Homo'))
mammals <- setTxnyms(mammals, new_txnym)
summary(mammals[['Homo_sapiens']])

treeman documentation built on July 8, 2020, 7:28 p.m.