Plotting issues in R Markdown

Good day, I'm having a problem while trying to do very basic plotting in R Markdown.

When I type the following code

plot(non_defaulters$income,  non_defaulters$balance, main = "Scatter Plot of Default(Blue) vs Non-Default(Red)", col = "red", ylab = "Balance", xlab = "Income",points(defaulters$income, defaulters$balance, col = "blue"))
abline(-w[1]/w[3],-w[2]/w[3], col = "green")

I get the error

Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet

When I use a normal r script it works fine, just not in R Markdown

I appreciate any and all assistance.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.