[R] Lattice plot within a "for" loop does not happen?

From: George W. Gilchrist <gwgilc_at_wm.edu>
Date: Sat 14 May 2005 - 00:09:16 EST


I am trying to do a series of xyplots plots, using a "for" loop to substitute the appropriate variables for each plot. The basic command works fine by itself and produces a nice plot:

> i<-3
> trellis.device(theme="col.whitebg")
> xyplot(as.formula(paste(tmp00[2*i], "~ ", tmp00[(2*i)-1],

+                             "|Blastomere+Phenotype", sep="")),
+         data=tmp1,
+         panel=function(x,y,...){
+           panel.xyplot(jitter(x), jitter(y), pch=16, col="red")
+           if (max(x, na.rm=T)!=0.0) panel.xyplot(x, y, type="r",  
lwd=2)
+        })

>

BUT, when I stick this in a loop, I get a bunch of blank graphics devices. This happens even if the loop only executes once. I could just go through and do these one by one, but I was curious if I was overlooking something obvious. Thank you for any advice.


George W. Gilchrist                        Email #1: gwgilc@wm.edu
Department of Biology, Box 8795          Email #2: kitesci@cox.net
College of William & Mary                    Phone: (757) 221-7751
Williamsburg, VA 23187-8795                    Fax: (757) 221-6483
http://gwgilc.people.wm.edu/

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 Received on Sat May 14 00:17:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:45 EST