| as_ggplot | R Documentation |
Transform the output of
arrangeGrob() and
grid.arrange() to a an object of class
ggplot.
as_ggplot(x)
x |
an object of class gtable or grob as returned by the functions
|
an object of class ggplot.
# Creat some plots
bxp <- ggboxplot(iris, x = "Species", y = "Sepal.Length")
vp <- ggviolin(iris, x = "Species", y = "Sepal.Length",
add = "mean_sd")
# Arrange the plots in one page
# Returns a gtable (grob) object
library(gridExtra)
gt <- arrangeGrob(bxp, vp, ncol = 2)
# Transform to a ggplot and print
as_ggplot(gt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.