coordinates

0th

Percentile

sets spatial coordinates to create spatial data, or retrieves spatial coordinates

sets spatial coordinates to create spatial data, or retrieves spatial coordinates

Keywords
manip
Usage
coordinates(obj, ...)
	coordinates(object) <- value
Arguments
obj
object deriving from class "Spatial"
object
object of class "data.frame"
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. ~x+y), column numbers (e.g. c(1,2)) or column names (e.g. c("x","y")
...
additional arguments that may be used by particular instances
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

Aliases
  • coordinates
  • coordinates<-
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)
Documentation reproduced from package sp, version 1.0-11, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.