R/utils_warn.R

Defines functions warn_once

warn_once <- function(msg, id) {
  id <- paste0("modelsummary_warning_", id)
  msg <- paste(msg, "This warning appears once per session.")
  if (isTRUE(getOption(id, default = TRUE))) {
    warning(msg, call. = FALSE)
    opts <- list(FALSE)
    names(opts) <- id
    options(opts)
  }
}

Try the modelsummary package in your browser

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

modelsummary documentation built on June 8, 2025, 9:32 p.m.