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]]