curate: Curate a shared or personal library of packages

View source: R/curate.R

curateR Documentation

Curate a shared or personal library of packages

Description

Helper function to manage package installation across libraries

Usage

curate(
  pkg,
  repos = "https://packagemanager.rstudio.com/all/__linux__/xenial/latest",
  version = NULL,
  dest_lib = .libPaths()[1],
  git_provider = NULL,
  ...
)

Arguments

pkg

String, name of package to install or a valid URL if using GitHub/Gitlab

version

The desired version of the package to install. Defaults to latest.

dest_lib

String, the path to the library where packages will be installed. Default is the first path on ‘.libPaths()'. It’s recommended to use 'set_library()' prior to 'curate()'

git_provider

String, one of "github" or "gitlab". Default is NULL.

...

Additional arguments to be passed to 'install.packages', 'remotes::install_version', 'remotes::install_github', and 'remotes::install_gitlab'. Use this to pass authentication variables to git providers.

repo

Where to pull the package from. Default is RStudio Package Manager (https://packagemanager.rstudio.com/all/__linux__/xenial/latest). If NULL, specify the path to a source file in 'pkgs'.

Details

'curate()' lets you easily install packages into different libraries. It will manage the copying of packages to a path on DBFS, which will persist them from session to session on Databricks.

Value

The user library path

Examples

# Setting user library first
set_library("/dbfs/rk/my_packages")
curate(pkg = "broom")

# Install version, setting user library
curate(pkg = "broom", version = "0.4.2", lib = set_library("/dbfs/rk/my_old_packages"))

# Install GitHub
curate(repo = "RafiKurlansik/bricksteR")

# Install Gitlab
curate(repo = "jimhester/covr")

RafiKurlansik/bricksteR documentation built on Oct. 13, 2022, 6:58 a.m.