initSpatial<- | R Documentation |
initSpatial()<-
: Set the column names containing spatial data and the corresponding coordinate reference system for a SoilProfileCollection.
getSpatial()
: Get spatial data associated with a SoilProfileCollection
## S4 replacement method for signature 'SoilProfileCollection,ANY,ANY'
initSpatial(object, crs = NULL) <- value
## S4 replacement method for signature 'SoilProfileCollection,ANY,character'
initSpatial(object, crs = NULL) <- value
## S4 method for signature 'SoilProfileCollection'
getSpatial(object)
## S4 method for signature 'SoilProfileCollection'
coordinates(obj)
## S4 replacement method for signature 'SoilProfileCollection,ANY'
coordinates(object) <- value
## S4 replacement method for signature 'SoilProfileCollection,character'
coordinates(object) <- value
object |
A SoilProfileCollection |
crs |
Optional: character. Representation of Coordinate Reference System as |
value |
A formula specifying names of columns containing geometry (x and y coordinates), or character with the column names |
obj |
A SoilProfileCollection |
prj()
data(sp5)
# coordinates are stored in x and y column of site
sp5$x <- rnorm(length(sp5))
sp5$y <- rnorm(length(sp5))
# coordinates takes a formula object as input
initSpatial(sp5) <- ~ x + y
# optionally specify Coordinate Reference System (crs) on left-hand side
initSpatial(sp5, crs = "OGC:CRS84") <- ~ x + y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.