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)
)
phylo object
phylo object
dataframe with edge information, containing "from" and "to" columns
x position of tree2
filter the link between tree1 and tree2
parameters for geom_tree
parameters for geom_tree
parameters for geom_line
tree tip label
parameters for geom_tiplab
tree tip label
parameters for geom_tiplab
tree1 highlight data.frame
parameters for geom_hilight
scale_fill_ for highlight1
tree2 highlight data.frame
parameters for geom_hilight
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)
}
#> Loading required namespace: ggtree