[R] dotplot/Dotplot: connecting points within factor level across time

From: Benjamin Tyner <btyner_at_gmail.com>
Date: Sat 16 Sep 2006 - 20:28:53 GMT


For each level of the factor in dotplot, I have time points I'd like to connect with a line. In the example below, 'x' represents a starting time and 'd' a duration, and I wish to connect 'x' to 'x+d'. Ordinarily I would use Dotplot from hmisc for this, but I have not been able to find a time class that Dotplot will allow. I can get lattice dotplot to put the points up, but I've not figured out how to connect them. Any suggestions?

require(lattice)

z<-data.frame(y=factor(letters),
              x=structure(1:26,class=c("POSIXt","POSIXct"),tzone=""),
              d=runif(26))

# this puts the points, but does not connect them
p<-dotplot(y~x+I(x+d),

           data=z,
           scales=list(x=list(format="%M:%S"))
           )

zh<-z
zh$x<-as.numeric(zh$x)
require(hmisc)
# this connects them, but at the expense of the time info
ph<-Dotplot(y~Cbind(x,x,x+d),

            data=zh,
            pch=" ")



Thanks,
Ben



R-help@stat.math.ethz.ch 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 Sun Sep 17 06:34:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 19 Sep 2006 - 00:30:05 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.