xyplot(formula(result), result, type = c( 'g','l')) See ?formula (the part about the dataframe method) for details.
Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jul 19, 2019 at 6:28 AM Doran, Harold <hdo...@air.org> wrote: > Here is a toy example of what I want > > library(lattice) > result <- data.frame(score = 1:10, theta = seq(from = -5, to = 5, length = > 10)) > result$theta2 <- result$theta + .3 > xyplot(score ~ theta + theta2, result, type = c('g', 'l')) > > However, in reality, the number of variables along the x-axis will vary in > unknown ways. So, I collect them in a matrix, similar to something like > > thetaMat <- cbind(result$theta, result$theta2) > > I recall at one point being able to pass a matrix of some form, such as > xyplot(score ~ thetaMat[,1:ncol(thetaMat)], result, type = c('g', 'l')) > > This fails, and I am cannot recall the right usage for doing this without > having to stack the columns (which I'm hoping to avoid). > > Can anyone suggest the right usage for this concept? > > Thanks > > Harold > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.