R/is_chartor.R

Defines functions is_chartor

Documented in is_chartor

#' Test if the argument is either character or factor
#' @param x the object to check
#' @export
#' @importFrom assertthat 'on_failure<-'
is_chartor <- function(x) {
  is.character(x) | is.factor(x)
}
on_failure(is_chartor) <- function(call, env) {
  paste0(deparse(call$x), " is neither character nor factor")
}
INBO-Natura2000/n2khelper documentation built on April 5, 2022, 5:40 p.m.