simplifyColorData: Simplify Color Data by ID

Description Usage Arguments Details Author(s)

View source: R/simplifyColorData.R


Simplify multiple Munsell color observations associated with each horizon.


simplifyColorData(d, id.var = "phiid", ...)
mix_and_clean_colors(x, wt='pct', colorSpace='LAB')



a data.frame object, typically returned from NASIS, see details


character vector with the name of the column containing an ID that is unique among all horizons in d


further arguments passed on to mix_and_clean_colors(), see details


a data.frame object containing sRGB cordinates associated with a group of colors to mix


a character vector with the name of the column containing color weights for mixing


a character vector with the name of color space in which mixing is performed ("LAB" or "sRGB")


This function is mainly intended for the processing of NASIS pedon/horizon data which may or may not contain multiple colors per horizon/moisture status combination. simplifyColorData will "mix" multiple colors associated with horizons in d, according to IDs specified by id.var, using "weights" (area percentages) specified by the wt argument to mix_and_clean_colors. Mixing is performed in the CIE LAB color space by default.

The simplifyColorData function can be applied to data sources other than NASIS by careful use of the id.var and wt arguments. However, d must contain Munsell colors split into columns named "colorhue", "colorvalue", and "colorchroma". In addition, the moisture state ("Dry" or "Moist") must be specified in a column named "colormoistst".

The mix_and_clean_colors funcion can be applied to arbitrary data sources as long as x contains sRGB coordinates in columns named "r", "g", and "b". This function should be applied to chunks of rows within which color mixtures make sense.

There are examples in the KSSL data tutorial and the soil color mixing tutorial.


D.E. Beaudette

soilDB documentation built on Jan. 24, 2018, 1:02 a.m.