R/varcheck.R

Defines functions varcheck

Documented in varcheck

varcheck <- function(x, vars, msg) {

  check <- pmatch(vars, names(x))

  if(any(is.na(check))) {
    if(missing(msg))
      stop("Missing or misnamed variables:",
        paste(vars[is.na(check)], collapse = ", "))
    else
      stop(msg)
  }
}

Try the Rwinsteps package in your browser

Any scripts or data that you put into this service are public.

Rwinsteps documentation built on May 2, 2019, 1:08 p.m.