R/checkdf.R

checkdf <-
function (dataset, ...) 
{
  
  vars <- unlist(list(...))
  vars_count <- length(vars)
  
  i <- 0
  
  for (i in 1:vars_count)
  {
    var_name <- vars[i]
    
    if (!exists(var_name, dataset))
    { 
      stop(paste("Variable", var_name, "not found"), call. = FALSE)
    }  
  }
}

Try the MCI package in your browser

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

MCI documentation built on May 2, 2019, 6:02 a.m.