File: spRbind-methods.Rd

package info (click to toggle)
r-cran-maptools 1%3A0.8-30-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,896 kB
  • ctags: 230
  • sloc: ansic: 3,007; makefile: 3
file content (61 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download | duplicates (7)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
\name{spRbind-methods}
\docType{methods}
\alias{spRbind-methods}
\alias{spRbind,SpatialPoints,SpatialPoints-method}
\alias{spRbind,SpatialPointsDataFrame,SpatialPointsDataFrame-method}
\alias{spRbind,SpatialLines,SpatialLines-method}
\alias{spRbind,SpatialLinesDataFrame,SpatialLinesDataFrame-method}
\alias{spRbind,SpatialPolygons,SpatialPolygons-method}
\alias{spRbind,SpatialPolygonsDataFrame,SpatialPolygonsDataFrame-method}
\alias{spRbind}
\title{rbind for spatial objects}
\description{
 \code{spRbind} provides rbind-like methods for Spatial*DataFrame objects
}
\section{Methods}{
\describe{

\item{obj = "SpatialPoints", x = "SpatialPoints"}{rbind two SpatialPoints objects}

\item{obj = "SpatialPointsDataFrame", x = "SpatialPointsDataFrame"}{rbind two SpatialPointsDataFrame objects}

\item{obj = "SpatialLines", x = "SpatialLines"}{rbind two SpatialLines objects}

\item{obj = "SpatialLinesDataFrame", x = "SpatialLinesDataFrame"}{rbind two SpatialLinesDataFrame objects}

\item{obj = "SpatialPolygons", x = "SpatialPolygons"}{rbind two SpatialPolygons objects}

\item{obj = "SpatialPolygonsDataFrame", x = "SpatialPolygonsDataFrame"}{rbind two SpatialPolygonsDataFrame objects}
}}

\note{
In addition to the \code{spRbind}-methods, there are also 
\code{rbind}-methods for Spatial* objects. The differences are:

\enumerate{
 \item{\code{spRbind}-methods can bind 2 objects, whereas \code{rbind}-methods 
     can bind multiple object}
 \item{some \code{rbind} can accept objects with duplicated IDs, for all 
     \code{spRbind}-methods these have to be modified explicitly, e.g. by 
     calling \code{\link[sp]{spChFIDs-methods}}}

}}

\author{Roger Bivand}

\seealso{\code{\link[sp]{spChFIDs-methods}}, \code{\link{spCbind-methods}}}

\examples{
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
}

\keyword{methods}
\keyword{spatial}