[R] Help with lines when x-axis is a date

From: Joe Trubisz <jtrubisz_at_mac.com>
Date: Tue, 27 May 2008 09:42:00 -0400


I have a set of data, that looks like the following:

date mornenzyme niteenzyme pdate

where date is the original data char string and pdate is the POSIX representation.
mornenzyme and niteenzyme are both float values.

What I want to do is plot pdate against both enzymes, by having a small blue circle
where the nite enzyme reading is and a red in the morning and for each date, have
them connected by a line.

I can easily do the points with a plot followed by a points command, but the line
has me stumped. I tried:

for(i in length(enz[,1]) {
lines(c(pdate[i],mornenzyme[i]),c(pdate[i],niteenzyme[i])) }

...but nothing plots. No line, no nothing and no error. Seems to be an issue when a date is
used as the x-axis. Not sure what the solution to this is. Any help appreciated.

PS: No...this is not time-series data, hence, cannot use ts.plot.


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. Received on Wed 28 May 2008 - 11:17:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 28 May 2008 - 12:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive