# NOT RUN {
xx <- maptools::readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], IDvar="FIPSNO")
yy <- as(xx,"data.frame")
yy$newvar <- sample(letters, nrow(yy), replace=TRUE)
yy <- subset(yy, select=c("FIPS", "newvar"))
newpoly <- mapmerge(xx, yy, xid="FIPS", yid="FIPS")
# }
Run the code above in your browser using DataLab