droptreedata.table {treedata.table}R Documentation

Function dropping taxa from an object of class treedata.table

Description

This function can be used to remove species from an object of class treedata.table. The resulting treedata.table will include fully matching ⁠$dat⁠ and ⁠$phy⁠ elements. The user should confirm the changes before they are processed.

Usage

droptreedata.table(tdObject, taxa)

Arguments

tdObject

An object of class treedata.table

taxa

A vector class character containing all taxa that needs to be dropped from the original treedata.table object

Value

An object of class treedata.table with matching ⁠$dat⁠ and ⁠$phy⁠ elements based on whether taxa were dropped or not.

Examples

data(anolis)
# With a multiphylo object in the treedata.table object
td <- as.treedata.table(anolis$phy, anolis$dat)
droptreedata.table(
  tdObject = td, taxa =
    c("chamaeleonides", "eugenegrahami")
)

# With a multiphylo object in the treedata.table object
treesFM <- list(anolis$phy, anolis$phy)
class(treesFM) <- "multiPhylo"
td <- as.treedata.table(treesFM, anolis$dat)
droptreedata.table(
  tdObject = td, taxa =
    c("chamaeleonides", "eugenegrahami")
)

[Package treedata.table version 0.1.0 Index]