Dear R users,
   I am a new R user. My problem is very simple: I want to add a linear 
regression line to the plot(type="p"), codes are as below:
 
x<-c(10,20,40,80)
y<-c(30,40,100,200)

plot(x,y,type="p")
lines(lm(x~y),col="red",lwd=1.5)
 
I got only plot without linear line.
Many thanks ahead for your advice!

Xipei Wang
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to