SpatialPointsDataFrame-class {sp} | R Documentation |
Class for spatial attributes that have spatial point locations
Objects can be created by calls of the form coordinates(x) = c("x", "y")
.
or of the form coordinates(x) = xy
; see coordinates.
data
:coords
:"matrix"
; the coordinates matrix
(points are rows in the matrix) coords.stripped
bbox
:"matrix"
; bounding boxproj4string
:"CRS"
; projection string
Class "SpatialPoints"
, directly.
Class "Spatial"
, by class "SpatialPoints"
.
signature(x = "SpatialPointsDataFrame")
: subset rows or
columns; in case of row subsetting, the coordinates are also subsetted signature(from = "SpatialPointsDataFrame", to = "data.frame")
: extracts the attribute part signature(obj = "SpatialPointsDataFrame")
: retrieves
the coordinates only signature(object = "SpatialPointsDataFrame")
: print method signature(object = "SpatialPointsDataFrame")
: summarize objectsignature(x = "SpatialPointsDataFrame")
: add points to plotEdzer J. Pebesma, e.pebesma@geo.uu.nl
coordinates
, SpatialPoints-class
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)