USDA Textural Soil Classification

Included in the next version (1.0.3.1) 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
library(ggtern)
library(plyr)
library(grid)

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

# 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)) +
  coord_tern(L="x",T="y",R="z") +
  geom_polygon(aes(fill = Label), 
               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)) +
  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

Adding Additional Points

A number of people have asked how to add additional points, try the following:

  df <- data.frame(SAND=runif(10),SILT=runif(10),CLAY=runif(10))
  last_plot() + geom_point(data=df,aes(y=CLAY,x=SAND,z=SILT))

References

[1] Unknown-Author, Soil Mechanics Level 1, Module 3, USDA Textural Classification Study Guide, United States Department of Agriculture, 1987.
[Bibtex]
@Book{usda,
Title = {Soil Mechanics Level 1, Module 3, USDA Textural Classification Study Guide},
Author = {Unknown-Author},
Publisher = {United States Department of Agriculture},
Year = {1987},
Owner = {Nick Hamilton},
Timestamp = {20140116}
}
Facebooktwittergoogle_plusredditlinkedinmail
Comments
  1. Abdelhamid Elshater
  2. Renata
  3. Nicholas Hamilton
  4. Rodrigo
    • Nicholas Hamilton
      • Raph
        • Nicholas Hamilton
          • Raph
  5. Ken
    • Nicholas Hamilton
      • Ken
        • Songchao
          • Ken
  6. Tyler
    • Nicholas Hamilton
      • Tyler
  7. Songchao
    • Nicholas Hamilton
      • Songchao
  8. Kate

Leave a Reply

Your email address will not be published. Required fields are marked *