%<+% {ggtree} | R Documentation

## %<+%

### Description

add annotation data to a tree

### Usage

    pg %<+% data

### Arguments

`pg` | ggplot2 object
`data` | annotation data

### Value

ggplot object with annotation data added

### Author(s)

Yu Guangchuang

### Examples

    nwk <- system.file("extdata", "sample.nwk", package="ggtree")
    tree <- read.tree(nwk)
    p <- ggtree(tree)
    dd <- data.frame(taxa=LETTERS[1:13],
       		 place=c(rep("GZ", 5), rep("HK", 3), rep("CZ", 4), NA),
                 value=round(abs(rnorm(13, mean=70, sd=10)), digits=1))
    row.names(dd) <- NULL
    p %<+% dd + geom_text(aes(color=place, label=label), hjust=-0.5)

[Package ggtree version 1.10.5 Index]