Introduction

Pending.

TODO

Examples

Source colors are in sRGB (D65) colorspace, as converted from Munsell notation using aqp::munsell2rgb().

Basic Idea

Trivial example using some of the aqp built-in data, not very interesting.

library(aqp)
library(plyr)
library(cluster)
library(ape)
library(colorspace)
library(soilDB)
library(sharpshootR)


data(sp1)
sp1$soil_color <- with(sp1, munsell2rgb(hue, value, chroma))
depths(sp1) <- id ~ top + bottom
plot(sp1)

# manually convert Munsell -> RGB
rgb.data <- munsell2rgb(sp1$hue, sp1$value, sp1$chroma, return_triplets = TRUE)
sp1$r <- rgb.data$r
sp1$g <- rgb.data$g
sp1$b <- rgb.data$b

pig <- soilColorSignature(sp1)
knitr::kable(pig, digits = 3, row.names = FALSE)
id .white.pigment .red.pigment .green.pigment .yellow.pigment .blue.pigment
P001 0.636 0.103 0 0.261 0
P002 0.670 0.123 0 0.207 0
P003 0.535 0.177 0 0.288 0
P004 0.598 0.150 0 0.252 0
P005 0.550 0.170 0 0.280 0
P006 0.639 0.123 0 0.239 0
P007 0.636 0.084 0 0.279 0
P008 0.614 0.097 0 0.289 0
P009 0.613 0.089 0 0.298 0

Plot results as dendrogram.

row.names(pig) <- pig[, 1]
d <- daisy(pig[, 2:6])
dd <- diana(d)

plotProfileDendrogram(sp1, dd, dend.y.scale = 0.25, scaling.factor = 0.001, y.offset = 0.02, width=0.15)

Colors from Official Series Descriptions

s.list <- c('amador', 'redding', 'pentz', 'willows', 'pardee', 'yolo', 'hanford', 'cecil', 'sycamore', 'KLAMATH', 'MOGLIA', 'boomer', 'vleck', 'drummer', 'CANEYHEAD', 'musick', 'sierra', 'HAYNER', 'zook', 'argonaut', 'PALAU')

# get these soil series
s <- fetchOSD(s.list)

# manually convert Munsell -> sRGB
rgb.data <- munsell2rgb(s$hue, s$value, s$chroma, return_triplets = TRUE)
s$r <- rgb.data$r
s$g <- rgb.data$g
s$b <- rgb.data$b

# check
par(mar=c(1,1,1,1))
plot(s)