Generate a color signature for each soil profile in a collection.
Usage
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
)Arguments
- spc
a
SoilProfileCollectionobject- 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,
colorBucket,depthSlices, orpam- 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
method = 'pam'- prob
numeric vector, requested percentiles for
method = 'depthSlices'- useProportions
use proportions or quantities, see details
- pigmentNames
names for resulting pigment proportions or quantities
- apply.fun
function passed to
aqp::profileApply(APPLY.FUN)argument, can be used to add progress bars viapbapply::pblapply(), or parallel processing withfurrr::future_map()- r
deprecated, use
colorargument- g
deprecated, use
colorargument- b
deprecated, use
colorargument- RescaleLightnessBy
deprecated, scaling factor for CIELAB L-coordinate
Value
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 inprob[1]...
L.n,A.n,B.n: CIELAB color coordinates associated with thendepth slice, at depth percentile given inprob[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 thenthcolor 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.
Details
Interpreation of color signature.
Choices related to weighting, scaling, and distance metric.
Perceptual distances (dE00), summed over color groups.
See the related tutorial.