[R] How to control plotting formula above lm diagnostic plots?

2012-11-22 Thread ksaw
Dear All, I am trying to plot four diagnostic plots for my lm in one window. Here is some random data for an example: a = rnorm(20, mean=2, sd=0.2) b = rnorm(20, mean=1, sd=0.4) model=lm(a~b) When I set the page as: par(mfrow=c(1,1), oma=c(1,0,2,0)) and plot my model: plot(model)

[R] Adding text to multiple plots

2012-01-24 Thread ksaw
Dear R-helpers, I am trying to add an information about the mean value for each variable within each plot by adding text to the multiple plots in this way: par(mfrow=c(2,2)) df$Date - as.Date(df$Date, format=%d/%m/%Y) for (i in 2:5){ plot(df$Date, df[[i]]) Mean -