#' fct_case_whn
#'
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
fct_case_when <- function(...) {
args <- as.list(match.call())
levels <- sapply(args[-1], function(f) f[[3]]) # extract RHS of formula
levels <- levels[!is.na(levels)]
factor(dplyr::case_when(...), levels=levels)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.