Hi Alina, It sounds like you want to dissolve the zips based on their membership in a district. If I have that right, then try the function unionSpatialPolygons. The example from the help is below.
Zev library(sp) library(gpclib) nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], proj4string=CRS("+proj=longlat +datum=NAD27")) lps <- coordinates(nc1) ID <- cut(lps[,1], quantile(lps[,1]), include.lowest=TRUE) reg4 <- unionSpatialPolygons(nc1, ID) sapply(slot(reg4, "polygons"), function(i) slot(i, "ID")) _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo