R/check_time_unit.R

Defines functions check_time_unit

Documented in check_time_unit

#' Check if the time unit is valid
#'
#' Will \link{stop} if not
#' @inheritParams default_params_doc
#' @author Richèl J.C. Bilderbeek
#' @export
check_time_unit <- function(time_unit) {
  time_units <- c("since", "ago")
  if (!time_unit %in% time_units) {
    stop(
      "time_unit must be either 'since' or 'ago'. ",
      "Actual value: ", time_unit
    )
  }

}

Try the nLTT package in your browser

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

nLTT documentation built on Aug. 21, 2023, 5:13 p.m.