plot_two_tree | R Documentation |
Plot two trees in one plot
plot_two_tree(
tree1,
tree2,
edge_df = NULL,
tree2_x = 10,
filter_link = FALSE,
tree1_param = list(),
tree2_param = list(),
line_param = list(),
tree1_tip = FALSE,
tip1_param = list(),
tree2_tip = FALSE,
tip2_param = list(),
tree1_highlight = NULL,
highlight1_param = list(),
highlight1_scale = NULL,
tree2_highlight = NULL,
highlight2_param = list(),
highlight2_scale = ggplot2::scale_fill_hue(na.value = NA)
)
tree1 |
phylo object |
tree2 |
phylo object |
edge_df |
dataframe with edge information, containing "from" and "to" columns |
tree2_x |
x position of tree2 |
filter_link |
filter the link between tree1 and tree2 |
tree1_param |
parameters for |
tree2_param |
parameters for |
line_param |
parameters for |
tree1_tip |
tree tip label |
tip1_param |
parameters for |
tree2_tip |
tree tip label |
tip2_param |
parameters for |
tree1_highlight |
tree1 highlight data.frame |
highlight1_param |
parameters for |
highlight1_scale |
scale_fill_ for highlight1 |
tree2_highlight |
tree2 highlight data.frame |
highlight2_param |
parameters for |
highlight2_scale |
scale_fill_ for highlight2 |
ggplot object
if (requireNamespace("ggtree")) {
data(otutab, package = "pcutils")
df2tree(taxonomy[1:50, ]) -> tax_tree
df2tree(taxonomy[51:100, ]) -> tax_tree2
link <- data.frame(from = sample(tax_tree$tip.label, 20), to = sample(tax_tree2$tip.label, 20))
plot_two_tree(tax_tree, tax_tree2, link)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.