tidytree (version 0.4.6)

drop.tip: drop.tip method

Description

drop.tip method

Usage

drop.tip(object, tip, ...)

keep.tip(object, tip, ...)

# S4 method for treedata drop.tip(object, tip, ...)

# S4 method for phylo drop.tip(object, tip, ...)

# S4 method for treedata keep.tip(object, tip, ...)

# S4 method for phylo keep.tip(object, tip, ...)

Value

updated object

Arguments

object

A treedata or phylo object

tip

a vector of mode numeric or character specifying the tips to delete

...

additional parameters

Author

Casey Dunn http://dunnlab.org and Guangchuang Yu https://guangchuangyu.github.io

See Also

drop.tip

Examples

Run this code
library(tidytree)
set.seed(123)
tr <- ape::rtree(6)
da <- data.frame(id=tip.label(tr), value = letters[seq_len(6)])
trda <- tr %>% dplyr::left_join(da, by = c('label'='id'))
tr1 <- drop.tip(tr, c("t2", "t1"))
tr2 <- keep.tip(tr, c("t2", "t1"))

Run the code above in your browser using DataLab