Description Usage Arguments Value Note Examples
Executes the full soil extraction process
1 2 3 | get_soil_data(df, lat_col = NULL, lon_col = NULL, country_iso,
soil_layers = c("ph", "carbon", "soil_texture", "sand", "silt", "clay",
"CEC", "p", "n"), raw_data_directory, country_polygon_directory)
|
df |
set of GPS points for which the user wants an export |
lat_col |
the latitude column in the data |
lon_col |
the longitude column in the data |
country_iso |
The country in which these points are located to trim down the data. |
soil_layers |
The soil variables the user wants returned in the dataframe for those soil points. The soil layers need to be one of the following: c(ph, carbon, soil_texture, sand, silt, clay, CEC, nitrogen) which are soil ph, carbon, soil texture, sand content, silt content, clay content, CEC, and soil nitrogen |
raw_data_directory |
The location where the data are located to know where to get the raw tif. This defaults to the current working directory. |
country_polygon_directory |
The file directory with the country polygon files. These are available for download with the get_country_polygon() function |
The original spdf data frame along with the extracted soil layers.
This function assumes the data remain named what they are when they're down loaded from the soil grids website. The units for the soil parameters are available on the repo website, https://github.com/one-acre-fund/soilgrids, as well as listed out here: pH - standard pH scale. Carbon (SOC) - g/kg. Nitrogen - mg/kg. Phosphorous - mg/kg. CEC - cmolc/kg. sand, silt, clay - country_iso = c("KEN", "RWA", "BDI", "TZA", "UGA", "ZMB", "MWI", "ETH", "IND", "NGA")
1 2 3 4 | ## Not run: get_soil_data(spdf = gps.data,
country.iso = "KEN", raw_data_directory,
country_polygon_directory)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.