Skip to contents

This function is a helper for setting the "updateme.sources" global option. It provides a user-friendly interface and validation of the options you set.

Usage

updateme_sources_set(...)

Arguments

...

Named or unnamed arguments. Values should be either:

  • One of names(getOption("repo")): latest versions will be taken from this source, if available

  • "bioc": new versions will be looked for on Bioconductor

  • "github"/"gitlab": new versions will looked for on on GitHub/GitLab, if a repo can be identified using the package DESCRIPTION

  • A URL pointing to a GitHub/GitLab repo, e.g. "https://github.com/wurli/updateme": the latest version for this particular package will be taken from this project

  • NA: updateme will not attempt to query new versions. Note that NA inputs must always be named (i.e. you must specify this 'per package')

  • NULL: return to the default behaviour

If arguments are named, names should indicate package which the option should apply to. If unnamed, the option will apply to all packages. See examples for more information.

Value

The result of setting options(updateme.sources = <new_options>)

Private Repositories

updateme supports packages installed from private repositories on GitHub and GitLab. To get upstream package version from either, you should only have to configure a personal access token (PAT):

  • For GitHub packages, updateme checks, in order:

    • The GITHUB_PAT environmental variable

    • The GITHUB_TOKEN environmental variable

    • Any personal access tokens configured using gitcreds::gitcreds_set()

  • For GitLab packages, updateme checks, in order:

    • The GITLAB_PAT environmental variable

    • The GITLAB_TOKEN environmental variable

    • Any personal access tokens configured using gitcreds::gitcreds_set()

See also

updateme_on() and updateme_off() to disable updateme for all packages

Examples

# If you want to check non-standard repos for new versions of packages,
# you'll first have to set the repos global option. Note that each
# option must be named for compatibility with updateme
old_repos <- options(repos = c(

  # Your default CRAN mirror will likely be something like this
  CRAN = "https://cloud.r-project.org",

  # The r-lib r-universe, including dev versions of infrastructure packages
  # like cli, rlang, etc
  `r-lib` = "https://r-lib.r-universe.dev"
))

# 1. New versions will first be looked up from the r-lib R universe by default
# 2. If not found, they will be looked up from the usual CRAN mirror
# 3. dplyr will always be first looked up from GitHub
# 4. ggplot2 won't be looked up or notified about
old_updateme_sources <- updateme_sources_set(
  "r-lib",
  "CRAN",
  dplyr = "https://github.com/tidyverse/dplyr", # Name is optional here
  ggplot2 = NA
)

# memoise should now be looked up from the r-lib r-universe
if (interactive()) {
  library(memoise)
}

# Restore old options
options(old_repos)
options(old_updateme_sources)