Hello Yarnabrina,
Wow, thank you so much! That was super helpful, and I got it to work. Thanks for such a quick response as well, I didn't expect being able to solve this tonight.
About the red green thing; it was not changing the line color green, I was just noticing the word red turned green in the console of demo I was watching.
I was able to switch some things around from your example and made it work with this code:
x <- c(173, 169, 176, 166, 161, 164, 160, 158, 180, 187)
y <- c(80, 68, 72, 75, 70, 65, 62, 60, 85, 92)
df <- data.frame(x, y)
rm(x, y)
plot(formula = (x ~ y), data = df, main = "scatterplot with regression line")
abline(reg = lm(formula = (x ~ y), data = df), col = "red")
Your example really helped. Thanks a bunch. I am taking an online forecasting class and there is very little instruction on the R program in the online class or the book. We are mostly using Excel, which I have a pretty good understanding of. We were introduced to R and I think it is a pretty awesome tool so I want to learn as much about it as I can. I will definitely be using this forum to help myself along.
Thanks again for the very quick and informative help. Enjoy your day or night.
-Chip