View source: R/soilColorSignature.R
| soilColorSignature | R Documentation |
Generate a color signature for each soil profile in a collection.
soilColorSignature(
spc,
color,
space = c("sRGB", "CIELAB"),
method = c("colorBucket", "depthSlices", "pam"),
perceptualDistMat = FALSE,
pam.k = 3,
prob = c(0.1, 0.5, 0.9),
useProportions = TRUE,
pigmentNames = c(".white.pigment", ".red.pigment", ".green.pigment", ".yellow.pigment",
".blue.pigment"),
apply.fun = lapply,
r = NULL,
g = NULL,
b = NULL,
RescaleLightnessBy = NULL
)
spc |
a |
color |
horizon-level attributes, either character of length 1 specifying a column containing Munsell or sRGB in hex notation, or character vector of three column names containing either sRGB or CIELAB color coordinates. sRGB color coordinates should be within the range of 0 to 1. |
space |
character, either 'sRGB' or 'LAB', specifying color space |
method |
algorithm used to compute color signature, |
perceptualDistMat |
logical, optionally return a distance matrix based on perceptual color distances, when “method‘ is one of ’depthSlices' or 'pam', see Details |
pam.k |
number of color classes for |
prob |
numeric vector, requested percentiles for |
useProportions |
use proportions or quantities, see details |
pigmentNames |
names for resulting pigment proportions or quantities |
apply.fun |
function passed to |
r |
deprecated, use |
g |
deprecated, use |
b |
deprecated, use |
RescaleLightnessBy |
deprecated, scaling factor for CIELAB L-coordinate |
Interpreation of color signature.
Choices related to weighting, scaling, and distance metric.
Perceptual distances (dE00), summed over color groups.
See the related tutorial.
For the colorBucket method, a data.frame:
id column: set according to idname(spc)
.white.pigment: proportion or quantity of CIELAB L-values
.red.pigment: proportion or quantity of CIELAB positive A-values
.green.pigment: proportion or quantity of CIELAB negative A-values
.yellow.pigment: proportion or quantity of CIELAB positive B-values
.blue.pigment: proportion or quantity of CIELAB negative B-values
Column names can be adjusted with the pigmentNames argument.
For the depthSlices method, a data.frame:
id column: set according to idname(spc)
L.1, A.1, B.1: CIELAB color coordinates associated with the first depth slice, at depth percentile given in prob[1]
...
L.n, A.n, B.n: CIELAB color coordinates associated with the n depth slice, at depth percentile given in prob[n]
For the pam method, a data.frame:
id column: set according to idname(spc)
L.1, A.1, B.1: CIELAB color coordinates associated with the first color cluster, after sorting all clusters in ascending order along L, A, B axes.
...
L.n, A.n, B.n: CIELAB color coordinates associated with the nth color cluster, after sorting all clusters in ascending order along L, A, B axes.
When perceptualDistMat = TRUE and method is one of 'depthSlices' or 'pam', a distance matrix is returned.
D.E. Beaudette
https://en.wikipedia.org/wiki/Lab_color_space
plotProfileDendrogram()
# trivial example, not very interesting
data(sp1)
depths(sp1) <- id ~ top + bottom
# Munsell notation
sp1$m <- sprintf("%s %s/%s", sp1$hue, sp1$value, sp1$chroma)
# extract color signature
pig <- soilColorSignature(sp1, color = 'm')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.