cran / XPolaris

:exclamation: This is a read-only mirror of the CRAN R package repository. XPolaris — Retrieving Soil Data from POLARIS. Homepage: https://github.com/lhmrosso/XPolaris Report bugs for this package: https://github.com/lhmrosso/XPolaris/issues
Other
0 stars 0 forks source link

XPolaris

Travis build
status AppVeyor build
status Codecov test
coverage CRAN
downloads

The XPolaris package aims to facilitate the access to detailed soil data at any geographical location within the United States (US). The POLARIS database comprises a 30-meter probabilistic soil series map of the contiguous United States (US). It represents an optimization of the Soil Survey Geographic (SSURGO) database, circumventing issues of spatial disaggregation, harmonizing, and filling spatial gaps [1, 2]. Without the need of advanced skills on R-programming, users will be able to convert raster data into traditional spreadsheet format for further data analyses.

Installation

You can install the released version of XPolaris from CRAN with:

install.packages("XPolaris")

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("lhmrosso/XPolaris")

Example

After loading the package, users must create a data.frame object containing three columns (ID, lat, and long). Location IDs must be unique alphanumerical identifiers, and latitude and longitude coordinates must be supplied as decimal degrees. The package comes with example locations in Kansas (exkansas).

library(XPolaris)
print(exkansas)
#>           ID     lat     long
#> 1    Scandia 39.8291 -97.8458
#> 2 Belleville 39.8158 -97.6720
#> 3     Ottawa 38.5398 -95.2446

The package is composed by three R functions:
1) xplot: generates a map displaying the rater images from which locations will be retrieved;
2) ximages: downloads the images from the POLARIS database to the user’s local machine;
3) xsoil: extracts the soil data from raster images and creates a data.frame object.

# Plotting image locations (checking images)
# The output is a ggplot object but a jpeg is exported
# Figure is saved in a new folder called (POLARISOut)
# A data.frame with coordinates is the main argument
# Locations must have unique ID codes

xplot(locations = exkansas)

# Downloading POLARIS images (POLARISOut folder)
# Important user inputs (see argument details below)
# Images are stored in the POLARISOut folder (sub-folders)
# This function does not download the same images twice
# Main arguments are either data.frame or vectors
# Vectors should contain character elements

df_ximages <- ximages(locations = exkansas,
                      statistics = c('mean'),
                      variables = c('ph','om','clay'),
                      layersdepths = c('0_5','5_15','15_30'))

# Retrieving raster soil data from images (points)
# The output is a data.frame but a csv file is exported
# ximages output is the main argument to extract soil data

xsoil(ximages_output = df_ximages)

ximages arguments

Code Description Data unit Output unit
ph Soil pH in water - -
om Soil organic matter log10(%) %
clay Clay % %
sand Sand % %
silt Silt % %
bd Bulk density g cm − 3 g cm − 3
hb Bubbling pressure (Brooks-Corey) log10(kPa) kPa
n Measure of pore size distribution (van Genuchten) - -
alpha Scale param. inversely prop. to mean pore diameter log10(kPa − 1) kPa − 1
ksat Saturated hydraulic conductivity log10(cm hr − 1) cm hr − 1
lambda Pore size distribution index (Brooks-Corey) - -
theta_r Residual soil water content m3 m − 3 m3 m − 3
theta_s Saturated soil water content m3 m − 3 m3 m − 3

References

  1. Chaney NW, Wood EF, McBratney AB, Hempel JW, Nauman TW, Brungard CW, et al. POLARIS: A 30-meter probabilistic soil series map of the contiguous united states. Geoderma. 2016;274:54–67. https://doi.org/10.1016/j.geoderma.2016.03.025.

  2. Chaney NW, Minasny B, Herman JD, Nauman TW, Brungard CW, Morgan CLS, et al. POLARIS soil properties: 30-m probabilistic maps of soil properties over the contiguous united states. Water Resources Research. 2019;55:2916–38. https://doi.org/10.1029/2018WR022797.