Emits or installs the R code lines that point options(repos) at a Posit
Package Manager binary repository. With dry_run = TRUE (the default),
the lines are returned without touching any file, so the user can review
them before applying. When dry_run = FALSE, path must always be
supplied explicitly; no file is ever chosen automatically.
Usage
use_ppm(
scope = c("user", "project"),
platform = NULL,
repo = "cran",
dry_run = TRUE,
path = NULL
)Arguments
- scope
Intended
.Rprofilelocation,"user"or"project". The function never picks a file itself;scopeonly shapes the path suggestion shown whendry_run = FALSEis called withoutpath(the user.Rprofilefor"user", the project.Rprofilefor"project").- platform
Platform specification accepted by
resolve_platform().- repo
Repository name.
- dry_run
If
TRUE, return the lines that would be written without editing files.- path
Explicit
.Rprofilepath. Required whendry_run = FALSE.
See also
Other ppm:
check_ppm(),
ppm_platforms(),
ppm_repo(),
ppm_sysreqs()
Examples
use_ppm("user", platform = "ubuntu-22.04", dry_run = TRUE)
#> [1] "options("
#> [2] " repos = c("
#> [3] " CRAN = \"https://packagemanager.posit.co/cran/__linux__/jammy/latest\""
#> [4] " )"
#> [5] ")"
# Write to a throwaway .Rprofile under tempdir():
use_ppm(
"user",
platform = "ubuntu-22.04",
dry_run = FALSE,
path = file.path(tempdir(), ".Rprofile")
)
