R/utils.R

Defines functions paste_title wrn err as_hms

as_hms <- function(x) {
  hms::new_hms(x)
}

err <- function(...) stop(..., call. = FALSE)

wrn <- function(...) warning(..., call. = FALSE)

paste_title <- function(x, title) {
  if (is.null(title) || !nchar(title)) {
    return(x)
  }
  paste0(x, " [", title, "]")
}

Try the hmstimer package in your browser

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

hmstimer documentation built on Sept. 12, 2024, 7:36 a.m.