library(aqp)
library(soilDB)
library(plyr)
library(sharpshootR)
library(latticeExtra)
library(colorspace)
library(ggplot2)
library(treemapify)

Topics

  • photos
  • box photos
  • aqp sketches via plotSPC()
  • Munsell color spectra
  • colorscience package
  • previewColors()
  • colorQuantiles()
  • binning of soil profile photos via colordist package
  • soilColorSignature()
  • color mixing mix_and_clean_colors()
  • color RIC vis color book presentation
  • colors in context with common soil pigments
  • colors in context with full CIELAB space
  • examples of exotic colors: sulphides, manganese, etc.
  • poorly drained soils, reduced iron color ranges, gley pages
  • color by drainage class

Clarksville.

# get lab / morphologic data
# simplify colors
x <- fetchKSSL(series='clarksville', returnMorphologicData = TRUE, simplifyColors = TRUE)

# extract pedons into SoilProfileCollection
s <- x$SPC

# genhz
s$genhz <- generalize.hz(s$hzn_desgn, c('A', 'E', 'Bt', '2Bt', '3Bt'), pat=c('A', 'E', '^Bt', '2B', '3B'), non.matching.code = NA)
s$genhz <- factor(s$genhz, levels = guessGenHzLevels(s, "genhz")$levels)

table(s$genhz, useNA = 'always')
## 
##    A    E   Bt  2Bt  3Bt <NA> 
##  179  206  363  343  115   68

Previewing Colors

MDS representation of unique colors, based on CIE2000 distances.

previewColors(s$moist_soil_color, method = 'MDS', pt.cex = 1.5)
title('Clarksville Soil Colors')

Arrange colors in a grid, based on CIE2000 distances.

previewColors(s$moist_soil_color)
title('Clarksville Soil Colors')

White borders.

previewColors(s$moist_soil_color, border.col = 'white')
title('Clarksville Soil Colors')

No borders.

previewColors(s$moist_soil_color, border.col = NA)
title('Clarksville Soil Colors')

Order colors by horizon top depth.

no.na.idx <- which(!is.na(s$moist_soil_color))
previewColors(s$moist_soil_color[no.na.idx], method = 'manual', col.order = order(s$hzn_top[no.na.idx]), border.col = NA)
title('Clarksville Soil Colors')

Order colors by generalized horizon.

no.na.idx <- which(!is.na(s$moist_soil_color))
previewColors(s$moist_soil_color[no.na.idx], method = 'manual', col.order = order(s$genhz[no.na.idx]), border.col = NA)
title('Clarksville Soil Colors')

Color Book Style Presentation

Color book style range for colors, frequency is represented as chip size.

# prepare vectors of Munsell chips + groups (generalized horizon labels)
m <- paste0(s$m_hue, ' ', s$m_value, '/', s$m_chroma)
g <- s$genhz

colorChart(m, g = g, chip.cex = 2)

Constant chip size, annotate with chip frequency.

colorChart(m, g = g, chip.cex = 2, size = FALSE, annotate = TRUE)