R/match_req.R

Defines functions match_req

# intended for required scalar characters like required dbIds
match_req <- function(...) {
  args <- list(...)
  non_empty <- function(s) {nchar(s) > 0}
  if (!lapply(args, non_empty) %>% unlist %>% all()) {
    stop("All parameters must have at least a length of one.")
  }
  args[[1]][1]
}
CIP-RIU/brapi documentation built on Oct. 17, 2019, 2 p.m.