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/n2khelper documentation built on March 26, 2022, 1:51 p.m.