I've seen this error posted elsewhere here, but I've not gotten any of the fixes to work. I'm currently using the built-in "faithful" dataset as part of the r-tutor.com tutorial:
duration = faithful$eruptions
waiting = faithful$waiting
abline(lm(duration ~ waiting))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
plot.new has not been called yet
I tried plot.new()
, no luck.
I tried
x <- (duration ~ waiting)
abline(x)
no luck.
I tried re-starting R, no luck. Using 3.0.0 for Windows. Thanks.
abline
has to be called on an existing plot. You can't call it when nothing has been plotted.
You probably wanted to do this:
plot(duration ~ waiting, data=faithful)
abline(lm(duration ~ waiting, data=faithful))