plotly_mtg.mtg: Plot an interactive MTG

Description Usage Arguments Details Value See Also Examples

View source: R/plot_MTG.R

Description

Plot an interactive MTG

Usage

1
2
3
4
5
6
7
## S3 method for class 'mtg'
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

## S3 method for class 'Node'
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

Arguments

mtg

An MTG, as from read_mtg()

...

Names of the variables to be added to the tooltip (see details and examples).

.scale

The scale required for plotting

.angle

Insertion angle when branching

.phylotaxy

Is phylotaxy required ? Uses 180 degrees if TRUE.

Details

The name of each argument in ... will be the name of a the variable given in the tooltip, and the value will be the value of the corresponding variable given as value. The arguments in ... are automatically quoted and evaluated in the context of the mtg. They support unquoting and splicing. See the chapter about metaprogramming in the book "Advanced R" from H. Wickham for an introduction to these concepts.

Value

A plotly object of the MTG

See Also

mutate_mtg() to compute variables and add it to the tooltip with ....

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
filepath= system.file("extdata", "simple_plant.mtg", package = "XploRer")
MTG= read_mtg(filepath)
plotly_mtg(MTG)

# We can add more information to the tooltip, e.g. the values of the Length column:
plotly_mtg(MTG, Length)

# We can also use custom names for the variable in the tooltip:
plotly_mtg(MTG, node_width = Width)
# Here the tooltip will show the Width, labeled as "node_width"

VEZY/XploRer documentation built on Oct. 9, 2021, 10:05 p.m.