R/1.1.checkStratumRequirements.R

Defines functions checkStratumRequirements

checkStratumRequirements <- function(stratum) {
  if (dim(stratum)[2] > 1) {
    stop("Invalid 'stratum' argument. Must be one-dimensional!")
  } else if (typeof(stratum$value) == "character" | typeof(stratum$value) == "logical") {
    stop("Invalid 'stratum' argument. Shouldn't be character or logical!")
  } else if (any(is.na(stratum$value))) {
    stop("Invalid 'stratum' argument. Shouldn't have NA values!")
  } else if (any(stratum$value <= 0)) {
    stop("Invalid 'stratum' argument. Must be greater than zero!")
  }

  return(NULL)
}

Try the Mmcsd package in your browser

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

Mmcsd documentation built on March 31, 2023, 7:23 p.m.