Learn R Programming

ggfun (version 0.1.8)

td_filter: td-filter

Description

filter data for tree annotation layer

Usage

td_filter(..., .f = NULL)

Value

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

Arguments

...

Expressions that return a logical value.

.f

a function (if any, defaults to NULL) that pre-operate the data

Author

Guangchuang Yu

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.

References

For more detailed demonstration of this function, please refer to chapter 12.5.1 of Data Integration, Manipulation and Visualization of Phylogenetic Trees http://yulab-smu.top/treedata-book/index.html by Guangchuang Yu.

See Also

Examples

Run this code
if (FALSE) {
tree <- rtree(30)
## similar to 'ggtree(tree) + geom_tippoint()'
ggtree(tree) + geom_point(data = td_filter(isTip))
}

Run the code above in your browser using DataLab