Learn R Programming

medfate (version 0.8.2)

soilgridsParams: SoilGrids soil description fetcher

Description

soilgridsParams takes a vector of depths and returns a list of soil characteristics ready to use with soil function.

Usage

soilgridsParams(lat, long, depths = c(300, 500, 1200))

Arguments

lat

Latitude in decimal format

long

Longitude in decimal format

depths

A numeric vector indicating the desired depths, in mm

Value

A list with the following elements:

  • soilparams: A data frame containing the soil characteristics ready to use with the soil function.

  • soilgrids_Rhorizondepth: Depth to the R horizon (in mm).

  • soilgrids_Rhorizonprob: Probability of the R horizon.

  • soilgrids_absolutesoildepth: Absolute depth to bedrock (in mm).

Details

This function connects with the SoilGrids REST API (https://rest.soilgrids.org) to retrieve the soil physical and chemical characteristics for a site, selected by its coordinates. Also, in case the depths are not the default ones in the SoilGrids API, the function uses the trapezoidal rule to calculate the values for the desired depths (as described in Hengl et al. 2007). To do this, it uses internally the rjson and GSIF R packages. Although soil layer definition is taken from the input, the function includes absolute depth to bedrock and depth to the R horizon from SoilGrids, in case the user wants to redefine soil definition.

References

Hengl T, Mendes de Jesus J, Heuvelink GBM, Ruiperez Gonzalez M, Kilibarda M, Blagoti<U+0107> A, et al. (2017) SoilGrids250m: Global gridded soil information based on machine learning. PLoS ONE 12(2): e0169748. doi:10.1371/journal.pone.0169748.

See Also

soil, defaultSoilParams

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
  foo <- soilgridsParams(lat = 42.6667, long = -5.6333, depths = c(300, 600, 1200))
  foo_soil <- soil(foo$soilparams)
  foo_soil
  
# }

Run the code above in your browser using DataLab