Learn R Programming

treedata.table (version 0.1.0)

droptreedata.table: 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

Run this code
# NOT RUN {
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")
)
# }

Run the code above in your browser using DataLab