Learn R Programming

GSIF (version 0.5-5.1)

FAO.SoilProfileCollection-class: A class for FAO SoilProfileCollection

Description

A class for harmonized (FAO) soil profile records. Extends the "SoilProfileCollection" class from the aqp package.

Arguments

Slots

idcol:

object of class "character"; column name containing IDs

depthcols:

object of class "character"; two element vector with column names for horizon top, bottom depths

metadata:

object of class "data.frame"; metadata table

horizons:

object of class "data.frame"; table containing observations at different depths

site:

object of class "data.frame"; table containing observations at site locations

sp:

object of class "SpatialPoints"; locations of profiles

diagnostic:

object of class "data.frame"; table containing diagnostic properties

Data of class "FAO.SoilProfileCollection" must satisfy all of the following requirements (class validity):

  • All variable names must be registered in the Global Soil Data Registry;

  • All variable domains must correspond to the FAO Guidelines (2006 or later) for soil description or similar;

  • All values must pass the validity checks i.e. numeric values must be within physical limits defined in the SoilGrids Global Soil Data Registry;

References

See Also

SoilGrids-class, SpatialComponents-class, geosamples-class

Examples

Run this code
# NOT RUN {
library(aqp)
library(sp)

LONWGS84 = 3.90
LATWGS84 = 7.50 
UHDICM = 0
LHDICM = 30
SOURCEID = "ISRIC:NG0017"
SOURCEDB = "AfSP DB"
SPDFAO = "3"
TEXMHT = "SCL"
DCOMNS = "7.5YR_3_2"

sp1 <- new("FAO.SoilProfileCollection", 
  depthcols=c('UHDICM','LHDICM'),
  metadata=soil.vars, 
  horizons=data.frame(SOURCEID, UHDICM, LHDICM, TEXMHT, DCOMNS),
  site=data.frame(SOURCEID, SPDFAO, SOURCEDB),
  sp=SpatialPoints(data.frame(LONWGS84, LATWGS84), 
     proj4string=CRS("+proj=longlat +datum=WGS84"))
)
str(sp1)
# }

Run the code above in your browser using DataLab