formatMunsell: Format Munsell Notation from Hue, Value, and Chroma

View source: R/formatMunsell.R

formatMunsellR Documentation

Format Munsell Notation from Hue, Value, and Chroma

Description

Format hue, value, and chroma values into valid Munsell notation, or NA when not possible. The following rules are applied to the input:

  • for all hues other than N, there must be a valid hue, value, and chroma

  • N hues may specify chroma as 0, NA, or ” (empty string)

  • when standardHues = TRUE, hue must be a standard Munsell hue, see huePosition()

Usage

formatMunsell(
  hue,
  value,
  chroma,
  neutralConvention = c("zero", "empty"),
  standardHues = TRUE
)

Arguments

hue

character vector of Munsell hue

value

character or numeric vector of Munsell value

chroma

character or numeric vector of Munsell chroma

neutralConvention

character, neutral color encoding convention

Neutral colors are encoded as:

  • 'empty': N 3/

  • 'zero': N 3/0

standardHues

logical, when TRUE non-standard hues are converted to NA

Value

character vector of same length as hue, value, and chroma

Author(s)

D.E. Beaudette

See Also

launderMunsell()

Examples


d <- data.frame(
hue = c('10YR', NA, 'N', 'N', 'N', '5G', '5Z'),
value = c(4, 3, 2, 4, 3, NA, 4),
chroma = c(4, 3, NA, 0, NA_integer_, 6, 3)
)

formatMunsell(d$hue, d$value, d$chroma)
formatMunsell(d$hue, d$value, d$chroma, neutralConvention = 'empty')
formatMunsell(d$hue, d$value, d$chroma, standardHues = FALSE)

# all result in 'N 6/0' (neutralConvention = 'zero')
formatMunsell('N', 6, 0)
formatMunsell('N', 6, '')
formatMunsell('N', 6, NA)


aqp documentation built on April 30, 2026, 9:06 a.m.