R/isColor.R

Defines functions isColor

# Copied from a post by Josh O'Brien on Stack Overflow:
# https://stackoverflow.com/questions/13289009/check-if-character-string-is-a-valid-color-representation
isColor <- function(x) {
  sapply(x, function(X) {
    tryCatch(is.matrix(col2rgb(X)), error = function(e) FALSE)
  })
}

Try the seqHMM package in your browser

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

seqHMM documentation built on July 9, 2023, 6:35 p.m.