"Error in int_abline...plot.new has not been called yet"

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))

Adding a + after your plot command will work. I worked for me.

plot(y~x) + abline()

credit to Gabriel (2nd comment on the above solution). Though I should post it because usually I do not read the comments and since I am new it would not allow me to thank her. So I thought I should post it as an answer. Thanks, Gabriel. It worked for me as well.

Tags:

Plot

R