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 REAT package in your browser

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

REAT documentation built on Sept. 5, 2021, 5:18 p.m.