soiltexture: Functions for Soil Texture Plot, Classification and Transformation

USDA Soil Texture Triangle

The Soil Texture Wizard

Page content: In short | Introduction | Installation | Text based graphical user interface | List of classification systems implemented | Acknowledgements (contributors) | Other works and software on soil textures (triangles) | Articles related to soil texture triangles or systems | See also (other R projects)

Last update: 2017/03/29

!!The package soiltexture has mooved. The repository is now located on GitHub: https://github.com/julienmoeys/soiltexture!!

The text below is not up to date.

In short

Introduction

soiltexture is a package (extension) for the R, a free software environment for statistical computing and graphics.

soiltexture is a toolbox for plotting, classifying and transforming soil texture data (clay, silt and sand contents).

Soil texture data and soil texture classifications systems are traditionally visualised (plotted) on ternary diagrams
(called texture plots, texture diagrams or texture triangles).

soiltexture currently implements 17 soil texture classification systems from all around the world. See here for a gallery of available texture triangles, and see also the package vignette (after installing the package):

vignette( "soiltexture_vignette" )

See above for an on-line version of this vignette / tutorial.

Installation

Install R

You need to install beforehand the sofware R (“a free software environment for statistical computing and graphics”).

From R homepage, go to the CRAN homepage or (better) choose the nearest CRAN mirror.

From there, choose 'Download R for …' (Windows, Mac or Linux), and then choose 'base' or 'install R for the First time'.

From there (latest stable R release), download the software installation files (if you are running on Windows) and install the program on your computer (follow the instructions from the installer).

Note: Unless you know what you are doing, it is recommended to install the latest R release (it may not always be possible to install the package soiltexture on older versions of R, or some of the latest features might be missing).

Install soiltexture (stable release)

Open R, and type the command:

install.packages( "soiltexture" ) 

Install soiltexture (development version, from r-forge)

Note: This will only work with the latest (stable) version of R. You should also check on the package R-forge page that the “Build status” of soiltexture is “Current” (and not “Failed to build”).

Open R, and type the command:

 install.packages("soiltexture", repos="http://R-Forge.R-project.org") 

Note: It can take some days before r-forge updates its system to the latest R stable version (after a new stable release). You can check what version of R is used by clicking on “Show/Hide extra info” on the package R-forge page, and then checking “Windows binary” or “Source package”. The R version currently used on r-forge should appear there.

Install soiltexture (development version, from GitHub)

The GitHub mirror of soiltexture (Notice that I am not the maintainer of this page) makes it possible to use devtools package installation method to install the development version of the package soiltexture. It can be an interesting solution when using a version of R that is different from the one installed on r-forge (newer or older).

Install devtools (and maybe RTools)

Follow the instructions given on devtools GitHub page. See in particular “Updating to the latest version of devtools”.

Install soiltexture using devtools

Open R and type:

devtools::install_github("rforge/soiltexture/pkg/soiltexture")

Notice that you can install in the same way the package soiltexturetransformation by Wei Shangguan:

devtools::install_github("rforge/soiltexture/pkg/soiltexturetransformation")

For technical reason this package does not compile on r-forge (because of a dependency on drc that used to be on r-forge but is now developed outside of r-forge).

Text based graphical user interface

From version 1.3.0 the package soil texture comes along with a simple text-based graphical user interface.

After you have installed R and the package soiltexture, simply start R and type:

soiltexture::soiltexture_gui()

This will start the text-based graphical user interface. You will be asked a series of simple question (4 to 8. With a list of possible answers), to import soil texture data, visualise it on a texture triangle and classify the texture data according to a classification system. Without typing any other commands than the one above. You can also display an empty texture triangle (without data-points) and/or display a texture triangle without classification system.

More information on how to prepare your soil texture data can be found on the function help page. In R, type:

help( "soiltexture_gui" )

or simply

?soiltexture_gui

Note: An alternative way to call soiltexture_gui is to type:

library( "soiltexture" ) 
soiltexture_gui()

List of classification systems implemented

Below is a list of texture triangles implemented in the package, together with their 'code' in the package.

Acknowledgements (contributors)

Many of the texture classification systems listed above wouldn't have been implemented without the contribution of the following people (contributors of the package):

They contributed to make soiltexture a useful tool for many soil scientists, and to make the specifications of these texture triangles available in an open-source format.

Other works and software on soil textures (triangles)

Numerous other works and software exist that deal with soil textures and soil textures triangles. Nevertheless, to my knowledge, The Soil Texture Wizard is the only tool that offers an integrated set of functionalities for soil textures (smart graphs + classification + multi-triangle + multi-geometry).

Ternary graphs (without soil textures classes)

Ternary graphs (with soil textures classes)

Automatic classification

Articles related to soil texture triangles or systems

See also (other R projects)

Other projects exists that provides useful soil-related R functions (toolboxes for the pedometrician):

Other packages that may interest soil scientists are: