R/require_length_.R

###############################################################################
# (c) Maxim Sokolov
###############################################################################

require_length_ <- function(x, len){
  if (length(x) != len){
    stop("Variable ", deparse(substitute(x)),
         " is supposed to be of length ", len, ".")
  }

  invisible(TRUE)
}
max-sokolov/fmreg documentation built on May 21, 2019, 1:38 p.m.