USDA Textural Soil Classification

January 15, 2014

(This article was first published on ggtern: ternary diagrams in R, and kindly contributed to R-bloggers)

Included in the next version ( of ggtern, will be a new data set, taken from the USDA Textural Soil Classification[1] which we can use to reproduce the original diagram published by the United Stated Department of Agriculture.

Firstly let us load the packages and data:

# Load the required libraries

# Load the Data. (Available in ggtern next version)

# Put tile labels at the midpoint of each tile.
USDA.LAB = ddply(USDA, 'Label', function(df) {
    apply(df[, 1:3], 2, mean)

# Tweak
USDA.LAB$Angle = 0
USDA.LAB$Angle[which(USDA.LAB$Label == 'Loamy Sand')] = -35

Reconstructing the USDA’s Original Plot

Now let us construct the plot from the prepared data

# Construct the plot.
ggplot(data = USDA, aes(y=Clay, x=Sand, z=Silt, 
                        color = Label, 
                        fill = Label)) + 
  coord_tern(L="x",T="y",R="z") + 
  geom_polygon(alpha = 0.75, size = 0.5, color = 'black') + 
  geom_text(data = USDA.LAB, 
            aes(label = Label, angle = Angle), 
            color = 'black', 
            size = 3.5) + 
  theme_rgbw() + 
  theme_showsecondary() + 
  theme_showarrows() + 
  custom_percent("Percent") + 
  theme(legend.justification = c(0, 1), 
        legend.position      = c(0, 1), 
        axis.tern.padding    = unit(0.15, 'npc')) + 
  labs(title = 'USDA Textural Classification Chart', 
       fill  = 'Textural Class', 
       color = 'Textural Class')

plot of chunk unnamed-chunk-2

Comparison to Existing Format

The above reproduction looks considerably better than the originally published format [1].

plot of original


[1] Unknown-Author, Soil Mechanics Level 1, Module 3, USDA Textural Classification Study Guide, United States Department of Agriculture, 1987.
title = {Soil Mechanics Level 1, Module 3, USDA Textural Classification Study
publisher = {United States Department of Agriculture},
year = {1987},
author = {Unknown-Author},
owner = {Nick Hamilton},
timestamp = {20140116}

The post USDA Textural Soil Classification appeared first on ggtern: ternary diagrams in R.

To leave a comment for the author, please follow the link and comment on their blog: ggtern: ternary diagrams in R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)