R/CHECKING-check_formula.R

Defines functions .check_formula

.check_formula <- function(formula) {
  
  if (is.null(formula)) {
    stop("No \"formula\" provided.", 
         call. = FALSE)
  }
  
  if (length(formula) > 1) {
    stop("This function can only handle individual \"formula\" entries.\nFor functional programming, try using it in apply() or purrr::map().", 
         call. = FALSE)
  }
  
  if (!is.character(formula)) {
    stop("The provided \"formula\" is not a character vector.", 
         call. = FALSE)
  }
  
}
NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.