Skip to content

Instantly share code, notes, and snippets.

@jrosell
Created September 7, 2023 14:35
Show Gist options
  • Save jrosell/3b8647a085e4638de86fe21805782810 to your computer and use it in GitHub Desktop.
Save jrosell/3b8647a085e4638de86fe21805782810 to your computer and use it in GitHub Desktop.
A way to install r-universe.dev packages using rlang::check_installed to interactively ask if possible, fails if not.
# remove.packages(c("universe", "sfdep"))
rlang::check_installed("universe", action = \(pkg, ...) {
install.packages('universe', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))
})
universe::add("ropensci")
universe::add("josiahparry")
rlang::check_installed("sfdep")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment