R/check_format.R

Defines functions check_format

check_format <- function(format) {
  if (is.null(format)) {
    stop("format must not be NULL")
  }

  allowed_formats <- c("nc", "csv")
  if (!format %in% allowed_formats) {
    stop(paste0("format must be either nc or csv, but was ", format))
  }
}

Try the cmsafops package in your browser

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

cmsafops documentation built on Sept. 18, 2023, 5:16 p.m.