geom_tree: geom_tree

View source: R/geom_tree.R

geom_treeR Documentation

geom_tree

Description

add tree layer

Usage

geom_tree(
  mapping = NULL,
  data = NULL,
  layout = "rectangular",
  multiPhylo = FALSE,
  continuous = "none",
  position = "identity",
  ...
)

Arguments

mapping

aesthetic mapping

data

data of the tree

layout

one of 'rectangular', 'dendrogram', 'slanted', 'ellipse', 'roundrect', 'fan', 'circular', 'inward_circular', 'radial', 'equal_angle', 'daylight' or 'ape'

multiPhylo

logical, whether input data contains multiple phylo class, defaults to "FALSE".

continuous

character, continuous transition for selected aesthethic ('size' or 'color'('colour')). It should be one of 'color' (or 'colour'), 'size', 'all' and 'none', default is 'none'

position

Position adjustment, either as a string, or the result of a call to a position adjustment function, default is "identity".

...

additional parameter

some dot arguments:

  • nsplit integer, the number of branch blocks divided when 'continuous' is not "none", default is 200.

Value

tree layer

Aesthetics

geom_tree() understands the following aesthethics:

  • color character, control the color of line, default is black (continuous is "none").

  • linetype control the type of line, default is 1 (solid).

  • linewidth numeric, control the width of line, default is 0.5 (continuous is "none").

Author(s)

Yu Guangchuang

References

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

Examples

tree <- rtree(10)
ggplot(tree) + geom_tree()

GuangchuangYu/ggtree documentation built on June 1, 2024, 5:48 a.m.