R/update_modelsummary.R

Defines functions update_modelsummary

Documented in update_modelsummary

#' Update `modelsummary` and its dependencies
#'
#' Update `modelsummary` and its dependencies to the latest R-Universe or CRAN versions. The R session needs to be restarted after install.
#'
#' @param source one of two strings: "development" or "cran"
#' @export
update_modelsummary <- function(source = "development") {
  checkmate::assert_choice(source, choices = c("development", "cran"))
  if (source == "development") {
    repo_easystats <- "https://easystats.r-universe.dev"
    repo_vab <- "https://vincentarelbundock.r-universe.dev"
  } else {
    repo_vab <- repo_easystats <- getOption("repos")["CRAN"]
  }
  utils::install.packages("insight", repos = repo_easystats)
  utils::install.packages("parameters", repos = repo_easystats)
  utils::install.packages("performance", repos = repo_easystats)
  utils::install.packages("modelsummary", repos = repo_vab)
  utils::install.packages("tinytable", repos = repo_vab)
  msg <- "Please restart your R session"
  msg <- c("", strrep("#", nchar(msg)), msg, strrep("#", nchar(msg)))
  insight::format_alert(msg)
}

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.