Skip to content

The soilspec package: data and functions for the book 'Soil Spectral Inference with R'

License

Notifications You must be signed in to change notification settings

AlexandreWadoux/soilspec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version HitCount Project Status: Active The project has reached a stable, usable state and is being actively developed. minimal R version License: MIT CRANstatus

Soil Spectral Inference with R

Data and functions for the book Soil Spectral Inference with R - Analysing Digital Soil Spectra Using the R Programming Environment.

Installation

The soilspec package is available in this GitHub repository only. The package is likely to be updated in the future. It is recommended to re-install the package is you didn't use it for a long time. If any issue, send an email to Alexandre Wadoux or open an issue.

The package is installed using the following command.

# check if the devtools package is already installed
if (!require("devtools")) install.packages("devtools")

# install the soilspec package from GitHub
devtools::install_github("AlexandreWadoux/soilspec")

Short description

Functions

  • chBLCext: function to fit a convex hull to the region of interest. The regions of interest are absorbance or reflectance of some secondary clay minerals or iron oxides from vis-NIR spectra. The function contains three arguments and returns five values. The function argument description is obtained by ?soilspec::chBLCext.

  • eval: function to compute of a set of accuracy measures between observed and predicted continuous values or classes. The user must specify the type of variable, either quantitative or categorical. For both types of variable, a set of accuracy measures is reported. The list of accuracy measures is provided by writing ?soilspec::eval. The function contains three arguments and returns a number of accuracy measures.

  • myImagePlot: function to plot an image from a matrix. This simple function takes as single argument a matrix and returns a plot of this matrix. The functions details are accessed by writing ?soilspec::myImagePlot.

  • spectra2colour: this function converts spectra reflectance into RGB and Munsell colours. The functions take a single argument as input, a matrix or data frame of the spectra, and returns the colour for both RBG and Munsell charts. The function returns a data frame where each row is the spectrum followed by the colour. The function description is obtained by ?soilspec::spectra2colour.

  • css: function to determine the optimal number of spectra to be sent to the laboratory for soil analysis. This function works by comparing the probability density function (pdf) of the population to that of the sample set to assess the representativeness of the sample. The two pdfs are compared based on the mean Euclidean distance (msd). The functions contains eight arguments and returns three values. The function argument description is obtained by ?soilspec::css.

Datasets

  • datEPO: subset of the Geeves soil survey data in which the soil samples were scanned with different level of moisture content. The dataset is a list with four data frames. Description of each data frame is provided in the R documentation by writting ?soilspec::datEPO.

  • datsoilspc: spectra and associated values of laboratory analysed soil properties from the soil samples described in Geeves et al., (1994). The data provided is a data frame with five columns and 391 rows. The first four columns contain values of the clay, silt, sand and total carbon. The fifth columns is a matrix with the infrared spectra. The documentation can be accessed by writting ?soilspec::datsoilspc.

  • datStand: vis-NIR spectra of a standard material as described in Ben-Dor et al., (2015). The data are provided as a list with four data frames. The documentation and description of each of them is provided by writting ?soilspec::datStand.

  • mineralRef: a data frame containing specific mineral compounds measured by laboratory spectrometers. The data frame contained 13 columns. The first is the wavelength and the others are 12 spectra from mineral compounds. The full description is provided by writting ?soilspec::mineralRef.

  • rutherglenNIR: Small set of vis-NIR spectra collected from a soil profile. The documentation is provided by writting ?soilspec::rutherglenNIR.

  • specSoilCol: Small set of vis-NIR spectra with value of the soil horizon and soil type. In addition to the spectra, pictures of the soil samples were made and provided in the book. This enables the comparison of the colour retrieved from the spectra and that from the picture of the soil samples. The documentation is provided in ?soilspec::specSoilCol.

References

Ben Dor E, Ong C, Lau IC (2015) Reflectance measurements of soils in the laboratory: Standards and protocols. Geoderma 245-246:112–124

Geeves GW, Cresswell HP, Murphy BW et al (1994) Physical, chemical and morphological properties of soils in the wheat-belt of southern NSW and northern Victoria. NSW Department of Conservation; Land Management/CSIRO Division of Soils Occasional Report, CSIRO, Australia

Licence

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Help

Help are obtained using the R documentation provided in the package ?soilspec::<function>. The author can be contacted by email: alexandre.wadoux@sydney.edu.au.

Reference

Wadoux A.M.J.C., Malone B., Minasny B., Fajardo M., McBratney A.B. (2021) Soil Spectral Inference with R. Progress in Soil Science. Springer, Cham. https://doi.org/10.1007/978-3-030-64896-1

About

The soilspec package: data and functions for the book 'Soil Spectral Inference with R'

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages