Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

soilPalette

Soil Color Palette


Description

A very simple function for generating labeled swatches of soil colors. Largely based on colorspace::swatchplot.

Usage

soilPalette(
  colors,
  lab,
  lab.cex = 0.75,
  dynamic.labels = TRUE,
  x.inset = 0.01,
  y.inset = 0.01,
  ...
)

Arguments

colors

vector of hex colors (e.g. #A66E46FF)

lab

vector of labels

lab.cex

character scaling for labels

dynamic.labels

logical, adjust label colors for maximum contrast via invertLabelColor

x.inset

horizontal adjustment for labels

y.inset

vertical adjustment for labels

...

further arguments to colorspace::swatchplot

Note

The result is a simple figure on the active plotting device.

Author(s)

D.E. Beaudette

Examples

# maybe useful for teaching about soil color

par(mfrow=c(2,1), mar=c(1,1,1,1))

# demonstrate range of Munsell value
m <- sprintf('10YR %s/4', 2:8)
# convert to hex representation
cols <- parseMunsell(m)
# plot
soilPalette(cols, m)

# demonstrate range of Munsell chroma
m <- sprintf('10YR 4/%s', 2:8)
# convert to hex representation
cols <- parseMunsell(m)
# plot
soilPalette(cols, m)

aqp

Algorithms for Quantitative Pedology

v1.29
GPL (>= 3)
Authors
Dylan Beaudette [aut, cre], Pierre Roudier [aut, ctb], Andrew Brown [aut, ctb]
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.