File: coordinates.Rd

package info (click to toggle)
r-cran-sp 1%3A2.2-0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,856 kB
  • sloc: ansic: 1,091; sh: 14; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,445 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
\name{coordinates}
\alias{coordinates}
\alias{coordinates<-}

\title{ set spatial coordinates to create a Spatial object, or retrieve
spatial coordinates from a Spatial object}
\description{ set spatial coordinates to create a Spatial object, or retrieve
spatial coordinates from a Spatial object}
\usage{
	coordinates(obj, ...)
	coordinates(object) <- value
}
\arguments{
\item{obj}{ object deriving from class "Spatial" }
\item{object}{ object of class "data.frame" }
\item{value}{ spatial coordinates; either a matrix, list, or data
frame with numeric data, or column names, column number or a
reference: a formula (in the form of e.g. \code{~x+y}), column numbers
(e.g. \code{c(1,2)}) or column names (e.g. \code{c("x","y")}) specifying
which columns in \code{object} are the spatial coordinates. If the coordinates
are part of object, giving the reference does not duplicate them, giving
their value does duplicate them in the resulting structure.
}
\item{...}{additional arguments that may be used by particular methods}
}
\value{ usually an object of class SpatialPointsDataFrame; if the coordinates
set cover the full set of variables in object, an object of class SpatialPoints
is returned }
\examples{
# data.frame
data(meuse.grid)
coordinates(meuse.grid) <- ~x+y
gridded(meuse.grid) <- TRUE
class(meuse.grid)
bbox(meuse.grid)

data(meuse)
meuse.xy = meuse[c("x", "y")]
coordinates(meuse.xy) <- ~x+y
class(meuse.xy)

}
\keyword{manip}