R/refresh.R

Defines functions refresh

Documented in refresh

#' Package Refresh
#'
#' "Refresh" a package by unloading its namespace and immediately re-requiring
#' that namespace. This is useful if an updated version of the package has been
#' installed by another process on the machine in the meantime, to avoid
#' having to restart the R session.
#'
#' @param pkg Package name (character vector)
#'
#' @export
refresh <- function(pkg) {
  unloadNamespace(pkg)
  requireNamespace(pkg)
}
hkauhanen/hipster documentation built on July 4, 2020, 11:25 p.m.