#' 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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.