[R] plot continuous data vs clock time

Bill.Venables at csiro.au Bill.Venables at csiro.au
Tue Jan 18 06:02:41 CET 2011


plot(y~x, type="p", xlim = x[c(2,4)])

?
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of wangxipei
Sent: Tuesday, 18 January 2011 1:27 PM
To: r-help
Subject: [R] plot continuous data vs clock time

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 from 1:20 to 9:25, how can I set the xlim argument?
Any suggestions about the clock time plotting would be appreciated.
Xipei Wang
	[[alternative HTML version deleted]]

______________________________________________
R-help at 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.



More information about the R-help mailing list