[R] add a linear regression line to the plot

2011-01-13 Thread wangxipei
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 fo

[R] plot continuous data vs clock time

2011-01-17 Thread wangxipei
Dear R users, I have a question about ploting clock time, the example is as below: y<-seq(from=1, to=30, by=5) x<-c("0:01","1:20", "8:40", "9:25", "15:30", "21:23") x<-as.POSIXct(strptime(paste(x),"%H:%M")) plot(y~x, type="p") I got the plot, but if I want to plot the x range fr

[R] how to get the plot like this by R?

2011-04-16 Thread wangxipei
Dear R users, I see a graph (shown athttps://cid-c486ebef16722625.photos.live.com/self.aspx/%e6%88%91%e5%96%9c%e6%ac%a2%e7%9a%84%e8%8a%b1/untitled.bmp) in a published paper, which is very informative and clear. But I don't know what type the graph is. It looks like a sactter plot but

Re: [R] how to get the plot like this by R?

2011-04-16 Thread wangxipei
I am sorry for the fault. The figure is posted athttp://www.mediafire.com/i/?08b9f4um43vxvw8 (hope this works!). Thank John for the website. Xipei Wang, Ph.D. student -- Xipei Wang, Ph.D. student Department of Pharmaceutics, School of Pharmaceutical Sciences, Peking University Health Scienc

Re: [R] how to get the plot like this by R?

2011-04-17 Thread wangxipei
hopefully some of the other code or links will help. --- OnSat, 4/16/11, wangxipei wrote: From: wangxipei Subject: Re:Re: [R] how to get the plot like this by R? To: "John Kane" Received: Saturday, April 16, 2011, 8:36 AM I am sorry for the fault. The figure is posted ath