File: SpatialPointsDataFrame-class.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 (88 lines) | stat: -rw-r--r-- 3,324 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
\name{SpatialPointsDataFrame-class}
\docType{class}
\alias{SpatialPointsDataFrame-class}
\alias{[,SpatialPointsDataFrame-method}
\alias{coerce,SpatialPointsDataFrame,data.frame-method}
\alias{coerce,SpatialPointsDataFrame,SpatialPoints-method}
\alias{show,SpatialPointsDataFrame-method}
\alias{points,SpatialPointsDataFrame-method}
\alias{coordinates,SpatialPointsDataFrame-method}
\alias{as.data.frame.SpatialPointsDataFrame}
\alias{dim.SpatialPointsDataFrame}
\alias{print.SpatialPointsDataFrame}
\alias{ShowSpatialPointsDataFrame}
\alias{as.SpatialPoints.SpatialPointsDataFrame}
\alias{rbind.SpatialPointsDataFrame}
\alias{row.names.SpatialPointsDataFrame}

\title{Class "SpatialPointsDataFrame" }
\description{ Class for spatial attributes that have spatial point locations }
\section{Objects from the Class}{
Objects can be created by calls of the form \code{coordinates(x) = c("x", "y") }.
or of the form \code{coordinates(x) = xy}; see \link{coordinates}.
}
\section{Slots}{
  \describe{
    \item{\code{data}:}{Object of class data.frame containing
		the attribute data (may or may not contain the coordinates in its columns) }
    \item{\code{coords}:}{Object of class \code{"matrix"}; the coordinates matrix
	(points are rows in the matrix) }
	\item{\code{coords.nrs}}{Object of class logical; if TRUE, when
	the object was created the coordinates were retrieved from the data.frame,
	and hence stripped from it; after coercion to data.frame, e.g. by 
	as.data.frame(x), coordinates will again be added (as first few columns) 
	to the data.frame }
    \item{\code{bbox}:}{Object of class \code{"matrix"}; bounding box}
    \item{\code{proj4string}:}{Object of class \code{"CRS"}; projection string}
  }
}
\section{Extends}{
Class \code{"SpatialPoints"}, directly.
Class \code{"Spatial"}, by class \code{"SpatialPoints"}.
}
\usage{
  \S4method{[}{SpatialPointsDataFrame}(x, i, j, ..., drop = TRUE)
  \S4method{coerce}{SpatialPointsDataFrame,SpatialPoints}(from, to, strict=TRUE)
  \S4method{coerce}{SpatialPointsDataFrame,data.frame}(from, to, strict=TRUE)
  \S4method{coordinates}{SpatialPointsDataFrame}(obj)
  \S4method{show}{SpatialPointsDataFrame}(object)
  \S4method{points}{SpatialPointsDataFrame}(x)
  \method{rbind}{SpatialPointsDataFrame}(...)
}
\arguments{
  \item{x,from,obj,object}{\code{SpatialPointsDataFrame} object}
  \item{to}{class to which to coerce}
  \item{strict}{see \code{\link[methods]{as}}}
  \item{i}{row indices}
  \item{j}{column indices}
  \item{drop}{see \code{\link[base]{Extract}}}
  \item{...}{indices passed through}
}
\author{ Edzer Pebesma, \email{edzer.pebesma@uni-muenster.de} }

\seealso{
  \code{\link{coordinates}}, \code{\link{SpatialPoints-class}} 
}
\examples{
data(meuse)
xy = meuse[c("x", "y")] # retrieve coordinates as data.frame
class(meuse)
data(meuse) # reload data.frame
coordinates(meuse) = c("x", "y") # specify column names
class(meuse)
data(meuse) # reload data.frame
coordinates(meuse) = c(1, 2) # specify column names
class(meuse)
data(meuse) # reload data.frame
coordinates(meuse) = ~x+y # formula
class(meuse)
data(meuse) # reload data.frame
coordinates(meuse) = xy   # as data frame
class(meuse)
data(meuse) # reload data.frame
coordinates(meuse) = as.matrix(xy)   # as matrix
meuse$log.zn = log(meuse$zinc)
class(meuse)
dim(meuse)
}
\keyword{classes}