launderMunsell: Fix Common Errors in Munsell Notation

View source: R/launderMunsell.R

launderMunsellR Documentation

Fix Common Errors in Munsell Notation

Description

This function will "launder" colors in Munsell notation, fixing (and optionally flagging) the following:

  • colors specified with 0-chroma will be converted to neutral hue (N) and original value

  • for neutral colors, any chroma >0 will be set to 0

  • non-standard hues will be converted to NA (unless standardHues = FALSE)

Examples:

  • '10YR 2/0' -> 'N 2/0'

  • 'N 4/1 -> 'N 4/0'

  • '5Z 3/3' -> NA

  • '5YR 3/' -> NA (hues other than N must have a valid chroma)

See formatMunsell() for additional details.

Usage

launderMunsell(m, verbose = FALSE, ...)

Arguments

m

character vector of Munsell colors

verbose

logical, optionally return a data.frame comparing modifications

...

additional arguments to formatMunsell()

Value

either character vector, or when verbose = TRUE a data.frame

See Also

formatMunsell()

Examples


# => 'N 2/0'
launderMunsell('10YR 2/0')

# => 'N 4/0'
launderMunsell('N 4/1')

# alternative neutral convention => 'N 4/'
launderMunsell('N 4/0', neutralConvention = 'empty')

# => 'N 4/0'
launderMunsell('N 4/NA')
launderMunsell('N 4/')

# => 'N 4/0'
launderMunsell('5GY 4/0')

# not a standard hue => NA
launderMunsell('4ZR 4/6')

# missing chroma, not N => NA
launderMunsell('2.5Y 4/')

# invalid chroma => NA
launderMunsell('2.5Y 4/A')


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