munsell_to_rgb: Converts munsell colors to RGB colors

Description Usage Arguments Details Value Author(s) Examples

View source: R/munsell_to_rgb.R

Description

This funcion converts a vector of munsell colors in the form hue value/chroma into an RGB R color. Vectors are passed to 'as.character' for conversion. Hue and chroma must be strictly separated by a space, whereas chroma and value by a '/'. It is internally called in the 'plot.profile.data.frame' function.

Usage

1

Arguments

color

A string or vector containing Munsell color(s) in the form Hue value/chroma.

name

This argument is taken in the workflow of the 'plot.data.frame' function, with the purpose to give the horizon name in case of warning.

Details

The function separates Hue, value and chroma by calling 'substr' and then calls the function munsell2rgb aqp for the conversion into R colors. If the color is not existing (be either because of wrong separation between Hue value and chroma, or unexisting munsell color), it defaults to '#39302CFF' and returns a warning.

Value

A vector of R colors

Author(s)

Gianluca Filippa

Examples

1
2
##a 5Y 5/3 (dark brown) boxplot
boxplot(1:10, col=munsell_to_rgb(example[[6]][1]), main='A 5Y 5/3 (dark brown) boxplot')

Example output

Loading required package: aqp
This is aqp 1.10
Loading required package: lattice
Loading required package: munsell
Loading required package: splancs
Loading required package: sp

Spatial Point Pattern Analysis Code in S-Plus
 
 Version 2 - Spatial and Space-Time analysis

soilprofile documentation built on May 29, 2017, 10:50 p.m.