I want to have one figure with two plots, one of them is a ggplot2 object, and the second is a plot generated with gplots. For example combine the next two plots in a row:
library(ggplot2)
library(gplots) #For plotmeans
df = structure(list(age = c(14, 22, 35, 21, 88, 66, 14, 22, 35, 21),
values = c(22, 8, 1.9, 26.8, 32, 15.,1.9, 26.8, 32, 15.)),
.Names = c("age", "values"),
row.names = 1:10,
class = "data.frame")
ggplot(df, aes(values)) + geom_histogram()
plotmeans(df$values ~ df$age)
I tried grid
, gridExtra
, par
and layout
but w/o success.
Any idea how can I do so?