I am trying to attribute a plot to a variable in order to plot many graphs in the same plot. Here is the code:
hist(res.ins, breaks=500, freq=F, xlab="Residuals", main="A")
lines(x, dnorm(x, mean(res.ins, na.rm=T), sd(res.ins, na.rm=T)), col="red", lwd=2)
I'd like to store this graph in a variable plot1, but
plot1 <- hist(res.ins, breaks=500, freq=F, xlab="Residuals", main="A") +
lines(x, dnorm(x, mean(res.ins, na.rm=T), sd(res.ins, na.rm=T)), col="red", lwd=2)
...doesn work, I tried to use {...}, but it does not work as well.