tt_class: Classify soil texture using USDA texture triangle

Description Usage Arguments Details Value References

View source: R/tt_class.R

Description

Classify soil texture using USDA texture triangle

Usage

1
2
3
4
5
6
7
tt_class(
  tri.data,
  PiC.type = "n",
  css.names = NULL,
  text.sum = 100,
  collapse = NULL
)

Arguments

tri.data

Data frame containing the CLAY, SILT and SAND 'coordinates' of the texture data points to be classified. The data frame can contain more column than needed (ignored). The data frame must have column named CLAY, SILT and SAND (uppercase, the order has no importance) or named after the 'css.names' argument (alternative names). The sum of CLAY, SILT and SAND must be equal to 'text.sum' ('text.tol' determines the error tolerance).

PiC.type

Single character string. If equal to 'n', then a table of 0, 1, 2 or 3 is outputed (0 if the sample does not belong to a class, 1 if it does, 2 if it lies on an edge and 3 if it lies on a vertex). Notice that the accuracy of the classification is not garanteed for samples lying very close to an edge, or right on it. See <http://www.mail-archive.com/r-help@r-project.org/msg96180.html>

css.names

Vector of 3 character strings. Name of the columns in 'tri.data' that contains the CLAY SILT and SAND values, respectively. If NULL, default c("CLAY","SILT","SAND") value is assumed. Not to be confused with 'css.lab' that defines the labels of the CLAY SILT and SAND axes in the plot.

text.sum

Single numerical. Sum of the 3 particle size classes for each texture value (fixed). The real sum of the 3 particle size classes in 'tri.data' should be >= text.sum * (1-text.tol) OR <= text.sum * (1+text.tol), where 'text.tol' is an argument that can be changed. If some of the texture values don't match this requirement, an error occur (function fails) and TT.points.in.classes returns a of bad values with their actual particle size classes sum. You can 'normalise' you data table () prior to the use of TT.points.in.classes, by using the function TT.normalise.sum(), so all values match the 'text.sum' criteria. See also 'tri.sum.tst' that can be set to FALSE to avoid sum of particle size classes tests.

collapse

Single character string. If PiC.type = "t" and a sample lie on the edge of 2 texture classes, then both will be outputed in a single character string, separated by 'collapse'.

Details

This function is an adaptation/simplification of the TT.points.in.classes function from the soiltexture package, confined to classification using the USDA soil texture triangle. We incorporate it here to avoid the overhead of an X11 load (in Mac) that listing soiltexture as an import causes.

Value

Vector of USDA texture classes (PiC.type = "t") or integer or logical matrix showing which of all possible classes it fits within.

References

Julien Moeys (2016). soiltexture: Functions for Soil Texture Plot, Classification and Transformation. R package version 1.4.1. https://CRAN.R-project.org/package=soiltexture


ldemaz/rcropmod documentation built on Feb. 29, 2020, 10:17 p.m.