SpatialPoints
From sp v0.9-90
by Edzer Pebesma
create objects of class SpatialPoints or SpatialPointsDataFrame
create objects of class SpatialPoints-class or
SpatialPointsDataFrame-class from
coordinates, and from coordinates and data.frame
s
- Keywords
- manip
Usage
SpatialPoints(coords, proj4string=CRS(as.character(NA)), bbox = NULL)
SpatialPointsDataFrame(coords, data, coords.nrs = numeric(0),
proj4string = CRS(as.character(NA)), match.ID = TRUE, bbox = NULL)
Arguments
- coords
- numeric matrix or data.frame with coordinates (each row is a point); in case of SpatialPointsDataFrame an object of class SpatialPoints-class is also allowed
- proj4string
- projection string of class CRS-class
- bbox
- bounding box matrix, usually NULL and constructed from the data, but may be passed through for coercion purposes if clearly needed
- data
- object of class
data.frame
; the number of rows indata
should equal the number of points in thecoords
object - coords.nrs
- numeric; if present, records the column positions where
in
data
the coordinates were taken from (used by coordinates<-) - match.ID
- logical; if TRUE AND coords has rownames (i.e., coerced
to a matrix,
dimnames(coords)[[2]]
is not NULL), AND data has row.names (i.e. is a data.frame), then theSpatialPointsDataFrame
object is formed by matching the row names of
Value
SpatialPoints
returns an object of classSpatialPoints
;SpatialPointsDataFrame
returns an object of classSpatialPointsDataFrame
;
See Also
coordinates, SpatialPoints-class, SpatialPointsDataFrame-class
Community examples
Looks like there are no examples yet.