Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

td_filter

td-filter


Description

filter data for tree annotation layer

Usage

td_filter(..., .f = NULL)

Arguments

...

Expressions that return a logical value.

.f

a function (if any, default is NULL) that pre-operate the data

Details

The 'td_filter()' function returns another function that can be used to subset ggtree() plot data. The function can be passed to the 'data' parameter of geom layer to perform subsetting. All rows that satisy your conditions will be retained.

Value

A function to filter ggtree plot data using conditions defined by '...'.

Author(s)

Guangchuang Yu

See Also

Examples

tree <- rtree(30)
## similar to 'ggtree(tree) + geom_tippoint()'
ggtree(tree) + geom_point(data = td_filter(isTip))

ggtree

an R package for visualization of tree and annotation data

v2.4.2
Artistic-2.0
Authors
Guangchuang Yu [aut, cre, cph] (<https://orcid.org/0000-0002-6485-8781>), Tommy Tsan-Yuk Lam [aut, ths], Shuangbin Xu [aut] (<https://orcid.org/0000-0003-3513-5362>), Yonghe Xia [ctb], Justin Silverman [ctb], Bradley Jones [ctb], Watal M. Iwasaki [ctb], Ruizhu Huang [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.