spChFIDs-methods

0th

Percentile

change feature IDs in spatial objects

When the feature IDs need to be changed in SpatialLines* or SpatialPolygons* objects, these methods may be used. The new IDs should be a character vector of unique IDs of the correct length.

Keywords
methods, spatial
Note

It is usually sensible to keep a copy of the original feature IDs in the object, but this should be done by the user.

See Also

spCbind-methods, spRbind-methods

Aliases
  • spChFIDs-methods
  • spChFIDs,SpatialLines,character-method
  • spChFIDs,SpatialLinesDataFrame,character-method
  • spChFIDs,SpatialPolygons,character-method
  • spChFIDs,SpatialPolygonsDataFrame,character-method
  • spChFIDs
Examples
xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], 
  IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
row.names(as(xx, "data.frame"))
xx1 <- spChFIDs(xx, as.character(xx$CNTY_ID))
row.names(as(xx1, "data.frame"))
Documentation reproduced from package maptools, version 0.6-19, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.