View source: R/formatMunsell.R
| formatMunsell | R Documentation |
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()
formatMunsell(
hue,
value,
chroma,
neutralConvention = c("zero", "empty"),
standardHues = TRUE
)
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:
|
standardHues |
logical, when |
character vector of same length as hue, value, and chroma
D.E. Beaudette
launderMunsell()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.