how can I merge this two plots?
Thanks
library(tidyr)
library(openair)
dat=data.frame(
a=runif(100),
b=runif(100)
)
dat = gather(dat, columnNames, values)
colnames(dat)=c("model", "x")
dat$b=runif(200)
# plot-1
ggplot(dat, aes(x = x, y = b, group = model,
color = model, shape = model)) +
geom_point( aes(colour = model))
#plot-2
dat <- selectByDate(mydata, year = 2003)
dat <- data.frame(date = mydata$date, obs = mydata$nox, mod = mydata$nox)
dat <- transform(dat, month = as.numeric(format(date, "%m")))
mod1 <- transform(dat, mod = mod + 10 * month + 10 * month * rnorm(nrow(dat)),
model = "model 1")
mod1 <- transform(mod1, mod = c(mod[5:length(mod)], mod[(length(mod) - 3) :
length(mod)]))
mod2 <- transform(dat, mod = mod + 7 * month + 7 * month * rnorm(nrow(dat)),
model = "model 2")
mod3 <- transform(dat, mod = mod + 3 * month + 3 * month * rnorm(nrow(dat)),
model = "model 3")
mod.dat <- rbind(mod1, mod2, mod3)
TaylorDiagram(mod.dat, obs = "obs", mod = "mod", group = "model")
##Trial
mat <- matrix(c(1, 2, # First, second
3, 3), # and third plot
nrow = 2, ncol = 2,
byrow = TRUE)
layout(mat = mat)
plot1
plot2
####