get_taxa_name: get_taxa_name

Description Usage Arguments Details Value Author(s) Examples

View source: R/clade-functions.R

Description

get taxa name of a selected node (or tree if node=NULL) sorted by their position in plotting

Usage

1
get_taxa_name(tree_view = NULL, node = NULL)

Arguments

tree_view

tree view (i.e. the ggtree object). If tree_view is NULL, the last ggplot will be used.

node

internal node number to specify a clade. If NULL, using the whole tree

Details

This function extract an ordered vector of the tips from selected clade or the whole tree based on the ggtree() plot.

Value

ordered taxa name vector

Author(s)

Guangchuang Yu

Examples

1
2
3
tree <- rtree(30)
p <- ggtree(tree)
get_taxa_name(p)

Example output

Registered S3 method overwritten by 'treeio':
  method     from
  root.phylo ape 
ggtree v2.4.1  For help: https://yulab-smu.top/treedata-book/

If you use ggtree in published research, please cite the most appropriate paper(s):

[36m-[39m Guangchuang Yu. Using ggtree to visualize data on tree-like structures. Current Protocols in Bioinformatics, 2020, 69:e96. doi:10.1002/cpbi.96
[36m-[39m Guangchuang Yu, Tommy Tsan-Yuk Lam, Huachen Zhu, Yi Guan. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution 2018, 35(12):3041-3043. doi:10.1093/molbev/msy194
[36m-[39m Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36. doi:10.1111/2041-210X.12628


 [1] "t8"  "t11" "t7"  "t2"  "t20" "t28" "t25" "t12" "t24" "t21" "t18" "t9" 
[13] "t17" "t30" "t10" "t6"  "t4"  "t14" "t15" "t19" "t13" "t26" "t3"  "t27"
[25] "t1"  "t29" "t23" "t16" "t22" "t5" 

ggtree documentation built on Nov. 15, 2020, 2:09 a.m.