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, "]")
}
poissonconsulting/hmstimer documentation built on Nov. 20, 2024, 10:02 p.m.