treedata.table (version 0.1.0)

[[.treedata.table: Function for extract a named vector from an object of class treedata.table

Description

This function extracts a named vector for any trait from an object of class treedata.table.

Usage

# S3 method for treedata.table
[[(x, ..., exact = TRUE)

Arguments

x

An object of class treedata.table

...

Column name in class character

exact

whether exact search should be conducted

Value

A new object of class vector with names set to labels corresponding to tip labels in the provided treedata.table object.

See Also

data.table()

Examples

Run this code
# NOT RUN {
data(anolis)
# With a phylo object
td <- as.treedata.table(anolis$phy, anolis$dat)
td[["SVL"]]

# With a multiPhylo object
treesFM <- list(anolis$phy, anolis$phy)
class(treesFM) <- "multiPhylo"
td <- as.treedata.table(treesFM, anolis$dat)
td[["SVL"]]
# }

Run the code above in your browser using DataCamp Workspace