I have a script that essentially boils down to
model <- lm(d$o ~ d$t * d$w)
plot(model)
When I run these commands in interactive mode (RStudio), plot
will create four graphs. The user has to advance to the next graph by pressing enter.
Now, I want to run the commands in (almost) non-interactive mode and the plot
command to display only the first two graphs. The user of the script of course should still be required to mouse click or press enter after the R environment has displayed the first and second graph.
How could I achieve this?
Edit
It has been suggested that I use the which
parameter (being described in ?plot.lm
). Yet, if I change the respective line to
plot(model, which=1)
the script aborts with
Error in box(...) : invalid 'which' argument
Calls: plot -> plot.default -> localBox -> box
In addition: Warning messages:
1: In plot.window(...) : "which" is not a graphical parameter
2: In plot.xy(xy, type, ...) : "which" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
"which" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
"which" is not a graphical parameter
Execution halted