R/scrub_variables.R

#' identify unique variables in a character vector of model terms
#' @param ... character strings or vectors of model terms
#' @export

scrub_variables <- function(...){

  args = list(...) %>% reduce(c)

  # For CRAN
  . = NULL

  args %>%
    set_names(NULL) %>%
    paste(collapse=" + ") %>%
    paste("~", .) %>%
    as.formula() %>%
    all.vars()
}
bcjaeger/Solo documentation built on May 14, 2019, 11:03 p.m.