droptreedata.table: Function dropping taxa from an object of class...

Description Usage Arguments Value Examples

View source: R/droptreedata.table.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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")
)

ropensci/treedata.table documentation built on Sept. 12, 2021, 6:23 p.m.