R/nargchk.R

# nargchk.R
# This function examines the number of input arguments and returns an error message if
# the number is not between min and max, or else it returns an empty matrix.

nargchk <- function(min,max,number){
  errmsg <- "";
    if (number < min) {
       errmsg <- "Input arguments are less than required.";
    } else if (number > max) {
       errmsg <- "Input arguments are more than required.";
    }
  return(errmsg);
}

Try the control package in your browser

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

control documentation built on May 1, 2019, 7:33 p.m.