File: spChFIDs-methods.Rd

package info (click to toggle)
r-cran-sp 1:0.9-66-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,696 kB
  • ctags: 123
  • sloc: ansic: 1,475; sh: 6; makefile: 5
file content (42 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
\name{spChFIDs-methods}
\docType{methods}
\alias{spChFIDs-methods}
\alias{spChFIDs,SpatialLines,character-method}
\alias{spChFIDs,SpatialLinesDataFrame,character-method}
\alias{spChFIDs,SpatialPolygons,character-method}
\alias{spChFIDs,SpatialPolygonsDataFrame,character-method}
\title{change feature IDs in spatial objects}
\alias{spChFIDs}
\description{
 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.
}
\section{Methods}{
\describe{

\item{obj = "SpatialLines", x = "character"}{replace IDs in a SpatialLines object}

\item{obj = "SpatialLinesDataFrame", x = "character"}{replace IDs in a SpatialLinesDataFrame object}

\item{obj = "SpatialPolygons", x = "character"}{replace IDs in a SpatialPolygons object}

\item{obj = "SpatialPolygonsDataFrame", x = "character"}{replace IDs in a SpatialPolygonsDataFrame object}
}}

\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.}

\author{Roger Bivand}

\seealso{\code{\link[maptools]{spCbind-methods}}, \code{\link[maptools]{spRbind-methods}}}

\examples{
\dontrun{
require(maptools)
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"))
}
}
\keyword{methods}
\keyword{spatial}