On 03/05/2011 1:26 PM, Ryan Utz wrote:
Well... that could work. Problem is in the actual graphs I'm making, there
are to be>30 lines per graph (as many as 60 in some cases). Any way I could
use the lines command without having to write out 60 lines of code per
figure? That's why I like ablines; you just have to specify a single value
and it will put a horizontal line at that number.
Thanks,
Ryan
Write your own abline. For example, with your previously posted example:
xlim <- c(0, 5)
ylim <- c(0, 10)
abline2 <- function(h, v) {
if (!missing(h)) {
n <- length(h)
segments( rep(xlim[1], n), h, rep(xlim[2], n), h)
}
if (!missing(v)) {
n <- length(v)
segments( rep(ylim[1], n), v, rep(ylim[2], n), v)
}
}
Just replace your abline() call with abline2().
Duncan Murdoch
______________________________________________
[email protected] 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.