% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/formatMunsell.R
\name{formatMunsell}
\alias{formatMunsell}
\title{Format Munsell Notation from Hue, Value, and Chroma}
\usage{
formatMunsell(
  hue,
  value,
  chroma,
  neutralConvention = c("zero", "empty"),
  standardHues = TRUE
)
}
\arguments{
\item{hue}{character vector of Munsell hue}

\item{value}{character or numeric vector of Munsell value}

\item{chroma}{character or numeric vector of Munsell chroma}

\item{neutralConvention}{character, neutral color encoding convention

Neutral colors are encoded as:
\itemize{
\item 'empty': N 3/
\item 'zero': N 3/0
}}

\item{standardHues}{logical, when \code{TRUE} non-standard hues are converted to NA}
}
\value{
character vector of same length as \code{hue}, \code{value}, and \code{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:
\itemize{
\item for all hues other than N, there must be a valid hue, value, and chroma
\item N hues may specify chroma as 0, NA, or '' (empty string)
\item when \code{standardHues = TRUE}, hue must be a standard Munsell hue, see \code{\link[=huePosition]{huePosition()}}
}
}
\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)

}
\seealso{
\code{\link[=launderMunsell]{launderMunsell()}}
}
\author{
D.E. Beaudette
}
