bwplot in loop doesn't produce any output
Its a FAQ http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f
On 8/16/06, Nick Desilsky <ndesilsky at yahoo.com> wrote:
Hi,
running the following code by itself runs as expected.
----------------------------------------------------------------------------
k <- 1
i <- 2
j <- 3
NumName <- varnames[num.cols[k]]
FacNames <- varnames[fac.cols[c(i,j)]]
tmp <- paste(FacNames[1],NumName,sep="~")
fml <- formula(paste(tmp,FacNames[2],sep="|"))
bwplot(fml, data = X)
----------------------------------------------------------------------------
But when set into a loop, it doens't produce anything. I've tried sending the output to pdf(file="test.pdf"), and the pdf file stays empty.
for (i in 1:(lfc-1))
{
for (j in (i+1):lfc)
{
for (k in 1:lnc)
{
NumName <- varnames[num.cols[k]]
FacNames <- varnames[fac.cols[c(i,j)]]
tmp <- paste(FacNames[1],NumName,sep="~")
fml <- formula(paste(tmp,FacNames[2],sep="|"))
bwplot(fml, data = X)
}
}
}
Any thoughts ? And if you know how to unlock test.pdf for viewing while R is running, I'd appreciate this bit of info too (i've tried dev.off(), windows() and such, and test.pdf can only be viewed after shutting down R).
Thank you.
Nick.
---------------------------------
[[alternative HTML version deleted]]
______________________________________________ R-help at 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.