I am using the data.tree package to create some trees.
library(data.tree)
library(DiagrammeR)
acme <- Node$new("Acme Inc.")
accounting <- acme$AddChild("Accounting")
software <- accounting$AddChild("New Software")
standards <- accounting$AddChild("New Accounting Standards")
acme2 <- Node$new("Acme Inc. 2")
accounting2 <- acme2$AddChild("Accounting 2")
software2 <- accounting2$AddChild("New Software 2")
standards2 <- accounting2$AddChild("New Accounting Standards 2")
acme_plot <- plot(acme)
acme_plot2 <- plot(acme2)
I would like to put the two graphs next to each other in a grid. But as they are not ggplot
objects (and I cannot convert them via ggplotify
), I have failed with the following:
cowplot
par(mfrow)
I consulted this answer as well: Combine different grViz into a single plot but my trees are generated via a complex loop so I cannot generate them in the digraph boxes_and_circles call. Any ideas?