File: bind.Rd

package info (click to toggle)
r-cran-raster 3.6-31-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,300 kB
  • sloc: cpp: 2,367; ansic: 1,572; sh: 13; makefile: 2
file content (66 lines) | stat: -rw-r--r-- 1,676 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
\name{bind}

\docType{methods}

\alias{bind}

\alias{bind,SpatialPolygons,SpatialPolygons-method}
\alias{bind,SpatialLines,SpatialLines-method}
\alias{bind,SpatialPoints,SpatialPoints-method}
\alias{bind,matrix,matrix-method}
\alias{bind,matrix,missing-method}
\alias{bind,data.frame,data.frame-method}
\alias{bind,data.frame,missing-method}
\alias{bind,list,missing-method}


\title{ 
Bind Spatial* objects
}

\description{
Bind (append) Spatial* objects into a single object. All objects must be of the same vector type base class (SpatialPoints, SpatialLines, or SpatialPolygons)
}

\usage{
\S4method{bind}{SpatialPolygons,SpatialPolygons}(x, y, ..., keepnames=FALSE)

\S4method{bind}{SpatialLines,SpatialLines}(x, y, ..., keepnames=FALSE)

\S4method{bind}{SpatialPoints,SpatialPoints}(x, y, ..., keepnames=FALSE)

\S4method{bind}{data.frame,data.frame}(x, y, ..., variables=NULL)

\S4method{bind}{list,missing}(x, y, ..., keepnames=FALSE)
}


\arguments{
 \item{x}{Spatial* object or data.frame, or a list of Spatial* objects}
 \item{y}{Spatial* object or data.frame, or missing}
 \item{...}{Additional Spatial* objects}
 \item{keepnames}{Logical. If \code{TRUE} the row.names are kept (if unique)} 
 \item{variables}{character. Variable (column) names to keep, If \code{NULL}, all variables are kept} 
}

\value{
Spatial* object
}


\seealso{ \code{\link[sp]{merge}} }


\examples{
p <- readRDS(system.file("external/lux.rds", package="raster"))
mersch <- p[p$NAME_2=='Mersch', ]
diekirch <- p[p$NAME_2=='Diekirch', ]
remich <- p[p$NAME_2=='Remich', ]
remich$NAME_1 <- NULL
x <- bind(mersch, diekirch, remich)
plot(x)
data.frame(x)
}

\keyword{methods}
\keyword{spatial}