R/check_old_names.R

Defines functions check_old_names

check_old_names <- function(..., old_names) {
  dots <- list(...)
  if (length(dots) == 0) {
    return(invisible(TRUE))
  }
  problem <- old_names %in% names(dots)
  if (!any(problem)) {
    return(invisible(TRUE))
  }
  change <- sprintf(
    "\n`%s` -> `%s`", old_names[problem], names(old_names)[problem]
  )
  stop("some arguments changed name:", change, call. = FALSE)
}
INBO-BMK/multimput documentation built on Sept. 14, 2023, 6:04 p.m.