On Jan 30, 2010, at 10:33 AM, Jamie Smith wrote:
I am graphing longitudinal data from three time points. I'd like to
draw a
solid line from point 1 to point 2, and then a dashed line from
point 2 to
point 3. It works if I do it in two steps:
first.vector <- c(mean(year1$variable1), mean(year2$variable1))
second.vector <- c(NA, mean(year2$variable1), mean(year3$variable1))
Those don't look like adequate descriptions of a point to point graph
element.
plot(first.vector, type="b", xlim=c(1,3))
lines(second.vector, type="b", lty=2)
It's clunky, though, and I have a bunch of these to do. Can I
streamline it?
?segments #takes vector arguments for x0, y0, x1, y1, and also for
line type.
You would make the x1 and y1 vectors "offset" from x0 and y0 if you
wanted the segments continuous.
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
R-help@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.