Quantcast
Channel: Active questions tagged lm - Stack Overflow
Viewing all articles
Browse latest Browse all 124

Plot function issue - adding a line

$
0
0

My goal is to plot a line (red) using the plot function. This is what I have tried so far.

data("Nile")plot(Nile)fm0 <- lm(Nile ~ 1) ; summary(fm0)y1 <- c(rep(1097.75, 20), rep(848.9722, 80)) # Plot lines(fitted(fm0), col = "blue", lty = "dotted", lwd = 1)lines(y1, time(Nile), col = "red",  lwd = 2)

The line in red color is not showing. Not sure where I am going wrong.

Expecting a plot like this

enter image description here


Viewing all articles
Browse latest Browse all 124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>