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

geom_rootedge

geom_rootedge


Description

display root edge

Usage

geom_rootedge(rootedge = NULL, ...)

Arguments

rootedge

length of rootedge; use phylo$root.edge if rootedge = NULL (by default).

...

additional parameters

Additional parameters can be referred to the following parameters:

  • size control the width of rootedge, default is 0.5.

  • colour color of rootedge, default is black.

  • linetype the type of line, default is 1.

  • alpha modify colour transparency, default is 1.

Details

geom_rootedge is used to create a rootedge.

Value

ggtree rootedge layer

Author(s)

Guangchuang Yu

References

  1. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam (2017). ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution, 8(1):28-36. https://doi.org/10.1111/2041-210X.12628

Examples

library(ggtree)
set.seed(123)
## with root edge = 1
tree1 <- read.tree(text='((A:1,B:2):3,C:2):1;')
ggtree(tree1) + geom_tiplab() + geom_rootedge()

## without root edge
tree2 <- read.tree(text='((A:1,B:2):3,C:2);')
ggtree(tree2) + geom_tiplab() + geom_rootedge()

## setting root edge
tree2$root.edge <- 2
ggtree(tree2) + geom_tiplab() + geom_rootedge()

## specify length of root edge for just plotting
## this will ignore tree$root.edge
ggtree(tree2) + geom_tiplab() + geom_rootedge(rootedge = 3)

## For more information about tree visualization, please refer to the online book
## https://yulab-smu.top/treedata-book/chapter4.html

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.