initSpatial: Initialize Spatial Data in a SoilProfileCollection

initSpatial<-R Documentation

Initialize Spatial Data in a SoilProfileCollection

Description

⁠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

Usage

## 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

Arguments

object

A SoilProfileCollection

crs

Optional: character. Representation of Coordinate Reference System as "authority:code", integer EPSG code, WKT2019 or PROJ4 string, an sf crs or sp CRS object.

value

A formula specifying names of columns containing geometry (x and y coordinates), or character with the column names

obj

A SoilProfileCollection

See Also

prj()

Examples


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

ncss-tech/aqp documentation built on April 19, 2024, 5:38 p.m.