R/isCorrectLength.R

Defines functions isCorrectLength

isCorrectLength <-
function(arg, argLength = 1) { #spits out an error if argument is of wrong length. returns true if there are no errors (NULL or correct length)
  if (!is.null(arg)){
    if (length(arg) != argLength) {sprintf('Option %s takes argument of at most length %s', arg, argLength)}
    else {TRUE}
  }
  else {TRUE}
}

Try the Blaunet package in your browser

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

Blaunet documentation built on Sept. 27, 2022, 9:05 a.m.