Creating Soil Textural Triangles in R
Creating Soil Textural Triangles ⛛
How do you create a textural triangle form the data on clay, silt, and sand percent in soils? Or, how do you classify these data to their textural classes? Do you use some online sources for that?
R provides a comprehensive tool for creating these textural triangles in various textural classification systems all over the world such as USDA, ISSS, HYPRES, ASINE, GEPPA, etc. We will see in this blog, the use of R in creating textural triangles ⛛.
We need to install the package “soiltexture”. Use the following lines of code to install the package and load the library.
install.packages(
pkgs = "soiltexture" )
library(
soiltexture )
Now, set your working directory using function “setwd( )”.
path<- ("E:\\Blog") # Write your
working directory path here
setwd(path)
Do notice the “\\” in the path. It’s not “\”.
You can use “/” too instead of “\\”.
Next, read your data on particle size distribution, i.e., Sand, Silt, and Clay percent and see the content in it. I have used a data with six soil samples in this blog and named it “Texture” and saved it as .csv format.
mydata<-read.csv("Texture.csv", header = TRUE)
mydata
## ID CLAY SILT SAND OC
## 1 1 18.0 17.3 64.7 4.1
## 2 2 25.1 16.0 58.9 5.6
## 3 3 29.0 17.5 53.5 4.5
## 4 4 38.2 28.8 33.0 4.1
## 5 5 47.5 29.7 22.8 4.9
## 6 6 49.1 25.5 25.4 3.8
You can make a .csv file from this data.
Do notice the field names as “CLAY”, “SILT”, and “SAND”. This is the default field names the package recognizes. If the names are different, you have to define it in the codes.
Now, let’s start plotting the textural triangles. The function “TT.plot()” is used for this purpose. This will print an empty textural triangle with the default textural class system of HYPRES.
TT.plot()
The argument “class.sys = “
decides the system of textural classification system. See the table below:
|
Code |
Classification
system |
Remark |
|
TT.plot(class.sys = "none") |
None |
|
|
TT.plot(class.sys
= "USDA.TT") |
USDA textural triangle |
With old
labels |
|
TT.plot(class.sys = "USDA-NCSS.TT") |
USDA textural triangle |
New labels |
|
TT.plot(class.sys = "USDA1911") |
USDA textural triangle |
Whitney
version |
|
TT.plot(class.sys = "HYPRES.TT") |
European Soil Map
(HYPRES) texture triangle |
|
|
TT.plot(class.sys = "FR.AISNE.TT") |
French
’Aisne’ texture triangle |
|
|
TT.plot(class.sys = "FR.GEPPA.TT") |
French
’GEPPA’ texture triangle |
|
|
TT.plot(class.sys = "DE.BK94.TT") |
German Bodenartendiagramm |
|
|
TT.plot(class.sys = "DE.SEA74.TT") |
German ’Standortserkundungsanweisung’ |
For forest
soils |
|
TT.plot(class.sys = "DE.TGL85.TT") |
German ’landwirtschaftliche B¨oden’ |
For arable
soils |
|
TT.plot(class.sys = "ISSS.TT") |
ISSS
texture triangle |
|
|
TT.plot(class.sys = "UK.SSEW.TT") |
Soil Survey
of England and Wales (UK) |
|
|
TT.plot(class.sys = "AU2.TT") |
Australia |
|
|
TT.plot(class.sys = "BE.TT") |
Belgium |
|
|
TT.plot(class.sys = "CA.EN.TT") |
Canada |
|
|
TT.plot(class.sys = "ROM.TT") |
Romania |
|
|
TT.plot(class.sys = "BRASIL.TT") |
Brazil |
|
|
TT.plot(class.sys = "SiBCS13.TT") |
Brazil |
|
Some of the plots are shown
below:
We can always get the information about the various textural classification systems by using the function “TT.classes.tbl(class.sys = “___.TT”). The “___.TT” indicates the classification system. For example,
TT.classes.tbl(class.sys = "USDA.TT")
## abbr
name points
## [1,] "Cl" "clay" "24, 1, 5, 6, 2"
## [2,] "SiCl" "silty clay" "2, 6, 7"
## [3,] "SaCl" "sandy clay" "1, 3, 4, 5"
## [4,] "ClLo" "clay loam" "5, 4, 10, 11, 12, 6"
## [5,] "SiClLo" "silty clay
loam" "6, 12, 13, 7"
## [6,] "SaClLo" "sandy clay
loam" "3, 8, 9, 10, 4"
## [7,] "Lo" "loam" "10, 9, 16, 17, 11"
## [8,] "SiLo" "silty loam" "11, 17, 22, 23, 18, 19, 13,
12"
## [9,] "SaLo" "sandy loam" "8, 14, 21, 22, 17, 16, 9"
## [10,]
"Si" "silt" "18, 23, 26, 19"
## [11,]
"LoSa" "loamy
sand" "14, 15, 20,
21"
## [12,]
"Sa" "sand" "15, 25, 20"
So, the USDA system has 12 classes. The names and labels are displayed in the table. Similarly, we can get information for other systems, for example
TT.classes.tbl(class.sys = "DE.BK94.TT") [,1]
## [1] "Ss" "Su2" "Sl2"
"Sl3" "St2" "Su3" "Su4" "Slu"
"Sl4" "St3" "Ls2" "Ls3"
## [13] "Ls4"
"Lt2" "Lts" "Ts4" "Ts3"
"Uu" "Us" "Ut2" "Ut3"
"Uls" "Ut4" "Lu"
## [25] "Lt3"
"Tu3" "Tu4" "Ts2" "Tl" "Tu2" "Tt"
“[,1]” indicates that only first column should be displayed.
Now we will generate textural triangle with our data.
We have imported our data as “mydata”. We will use the same.
TT.plot(
class.sys = "USDA.TT", # mention the
textural class system
tri.data = mydata, # mention
data
main = "Soil texture data" # Title of the
graph
)
So, two samples are classified as clay, one clay loam, two as sandy clay loam, and one as sandy loam.
But, which sample??
We can display the sample IDs instead of points to resolve this issue.
First we need to get the labels. It’s the first column of the data.
labelz <-mydata[,1]
# Display the text
labelz
##
[1] 1 2 3 4 5 6
Now, get the textural triangle as an object
geo <- TT.plot(class.sys="USDA.TT")
Then, plot the triangle with sample numbers only
TT.text(
tri.data = mydata,
geo = geo,
labels = labelz,
font = 1,
col = "blue"
)
Now, we can get the textural classes against each sample in a new column. First we need to get a vector of textural class of the same length as the number of soil samples. We use the function “TT.points.in.classes()”.
Tex.class<-TT.points.in.classes(
tri.data = mydata,
class.sys = "USDA.TT",
PiC.type = "t"
)
We can see the textural classes of each sample now.
Tex.class
##
[1] "SaLo" "SaClLo"
"SaClLo" "ClLo"
"Cl" "Cl"
Now bind this field to the data and use the function “write.csv()” for exporting it as a new .csv file.
x <- cbind(mydata, Tex.class)
##Write
as csv file
write.csv(x,
file = "soiltextureclassdata.csv", row.names=FALSE)
The final output is here.
We can generate many fascinating textural triangles using R. some of them are shown below
A textural triangle with additional information of organic carbon on it
USDA and HYPRES triangles, overplotted
Thematic triangle
You can explore the package help page.
You can also consult the following book for generating various textural triangles and many more things related to infographics in soil science.










Very Informative.
ReplyDelete