inst/resources/activate.R

local({
  try_install_if_not_available <- function(pkg, source) {
    if (!requireNamespace(pkg, quietly=TRUE))
      try(renv::install(source), silent=TRUE)
  }

  try_install_if_not_available("rspm@VERSION")
  try_install_if_not_available("cran4linux/rspm@VERSION")
  try_install_if_not_available("cran4linux/rspm")

  try(rspm::enable(), silent=TRUE)
})

Try the rspm package in your browser

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

rspm documentation built on Oct. 29, 2024, 5:07 p.m.