Hi all,

I have the function below where I am attempting to create a list of spplots
for later use.  The problem is that the list come back blank for all
elements.  Why doesn't spplot return proper plots that could be used via
print()?
Please see the assignment to the plots list below - plots[[letter]] <-
spplot()


plotFSAs <- function(spatialData, field) {
plots <- list()
colours <- brewer.pal(8, "Greens")
 for(letter in LETTERS) {
inLetter <- substr(spatialData@data$CENSUS_FSA, 1, 1) %in% letter
fsa.spatial <- subset(spatialData, inLetter)
 classes <- classIntervals(fsa.spatial@data[,c(field)], length(colours),
style="equal")
 plots[[letter]] <- spplot(fsa.spatial,
field,
col.regions=colours,
at=classes$brks,
col="black",
lwd=0.8,
main=paste("FSAs Beginning with ", letter),
cex.main=0.3,
colorkey=list(
labels = list(
at=classes$brks,
labels=round(classes$brks, 2)
)
)
)
}
return(plots)
}


-- 
Mike Sukmanowsky

	[[alternative HTML version deleted]]

