Please help - strange plotting errors with very simple code

When trying to make very simple plots in R, very strange plots show up.
I'm not really sure how to describe the problem. I have only used R for about 2 months for my statistics class, but my final is on Monday and I can't study because no plots are showing up correctly. Sometimes it will just stop happening if I run enough code, but this time it is not.
There is not necessarily an error message, but it does say "plot (lm(cty~displ, cars))
Hit to see next plot: "
I uninstalled and reinstalled R

cars = read.csv('mpg.csv')
mode=lm(cty~displ, cars)
plot (lm(cty~displ, cars))

please note that this happens even if I put plot(mode) instead of plot (lm(cty~displ, cars))

If I click ctrl+enter a couple more times, then the graph will change to something even stranger.

It is normal to get four plots when you plot a model from lm(). You get Residuals vs Fitted, Normal Q-Q, Scale - Location, Residuals vs Leverage. Click on the Console (lower left pane in your image) and press return to see each plot.
What where you expecting to get with your plot function?

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.