R/colourvalues-package.R

Defines functions palette_check.matrix palette_check.default palette_check.character palette_check

#' @useDynLib colourvalues, .registration = TRUE
#' @importFrom Rcpp sourceCpp
NULL

# palette_check <- function( palette ) {
#   if ( nrow( palette ) < 5 )
#     stop("A matrix palette must contain at least 5 rows")
# }

palette_check <- function( palette ) UseMethod("palette_check")

#' @export
palette_check.character <- function( palette ) tolower( gsub("\\.","_", palette ) )

#' @export
palette_check.default <- function( palette ) palette

#' @export
palette_check.matrix <- function( palette ) {
  if ( nrow( palette ) < 5 )
    stop("A matrix palette must contain at least 5 rows")
  return( palette )
}

Try the colourvalues package in your browser

Any scripts or data that you put into this service are public.

colourvalues documentation built on April 11, 2023, 6:08 p.m.