spRbind-methods | R Documentation |
spRbind
provides rbind-like methods for Spatial*DataFrame objects
rbind two SpatialPoints objects
rbind two SpatialPointsDataFrame objects
rbind two SpatialLines objects
rbind two SpatialLinesDataFrame objects
rbind two SpatialPolygons objects
rbind two SpatialPolygonsDataFrame objects
In addition to the spRbind
-methods, there are also
rbind
-methods for Spatial* objects. The differences are:
spRbind
-methods can bind 2 objects, whereas rbind
-methods
can bind multiple object
some rbind
can accept objects with duplicated IDs, for all
spRbind
-methods these have to be modified explicitly, e.g. by
calling spChFIDs-methods
Roger Bivand
spChFIDs-methods
, spCbind-methods
xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
summary(xx)
xx$FIPSNO
xx1 <- xx[xx$CNTY_ID < 1982,]
xx2 <- xx[xx$CNTY_ID >= 1982,]
xx3 <- spRbind(xx2, xx1)
summary(xx3)
xx3$FIPSNO
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.