Skip to content
Prev 26531 / 29559 Next

how to plot different rows of a SpatialPolygonsDataFrame in trellis panels

Roger,
Thanks for responding.  I looked at the micromap vignettes but it seems their focus is being able to provide small maps in one column in figures where the main emphasis is on statistics presented in other columns.  In my problem, all I want to show are maps.  I haven't been able to do this with a higher-level function like spplot or stplot.  I can imagine doing it with a custom panel function, where lpolygons() is used with input that depends on the panel.  

In case it helps, I should clarify that the "different polygons" I referred to are polygons with different spatial coordinates; the attribute values are a small number of discrete values.  My polygons are representations of contaminant plumes in groundwater.  For each year, I have read in a shapefile containing polygons of the contaminant concentration at 2 to 4 levels.  I have combined all of these data into a SpatialPolygonsDataFrame, where each row represents a given year and concentration level, and contains one or more polygons.  The coordinates are different in each row, but years and concentration level are common across rows.  This seems to match the nature of a "long table" format in spacetime, but I haven't been able to work it out in that package, hence I'm stepping back and trying to get the basics working with spplot.

Thanks,
Scott