unionSpatialPolygons function in the
maptools package does this. You supply to it a
SpatialPolygons and a vector which indicates which polygons (zip codes, in your example) belong to which aggregated polygon (sales areas).
The help page on unionSpatialPolygons has a good example of creating a grouping/indexing vector. It using counties in North Carolina, but the ideas are the same. Pulling from that example:
nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools"),
Loads an example
SpatialPolygonsDataFrame. Extract from this whatever information you need that is one-per-polygon. The example gets single coordinates associated with the polygon (centroid?)
lps <- coordinates(nc1)
You can see these together:
You could do something with
nc1@data instead. Either have 100 entries, one for each polygon.
 100 14
 100 2
Then use whatever transformation/mapping to derive a length 100 vector that indicates the groups.
gpclibPermitStatus error probably means you don't have the
rgeos package installed and/or have not agreed to the more restrictive license of gpclib.