Displaying 1 result from an estimated 1 matches for "scatter_cty_hwy_co_tr".
2004 May 07
1
Lattice xyplot - problem trying to produce multiple output files with a 'for' loop
...de. I'm running 1.9 on Windows. BTW is there a more efficient way of creating the separate output files than looping over the levels and subsetting?
.........................................................
lev <- levels(ds$TR)
for (byvar in lev) {
file.png <- paste("u:/data/R/Scatter_CTY_HWY_CO_TR", byvar, ".png", sep="")
trellis.device( device="png", file=file.png,
width=1000, height=1000, pointsize=20, bg="transparent" )
ds1 <- subset(ds, TR == byvar, select=c(CTY, HWY, CO))
xyplot( ds1$CTY ~ ds1$HWY, groups=ds1$CO,
auto.key=...