install_pkgs: Install (Missing) Packages

Description Usage Arguments Details Value Examples

View source: R/install_pkgs.R

Description

extract_pkgs() extracts required package from various objects, including TaskGenerator, Learner, Measure and objects from extension packages such as mlr3pipelines or mlr3filters. If applied on a list, the function is called recursively on all elements.

install_pkgs() calls extract_pkgs() internally and proceeds with the installation of extracted packages.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
install_pkgs(x, ...)

extract_pkgs(x)

## S3 method for class 'character'
extract_pkgs(x)

## S3 method for class 'R6'
extract_pkgs(x)

## S3 method for class 'list'
extract_pkgs(x)

## S3 method for class 'ResampleResult'
extract_pkgs(x)

## S3 method for class 'BenchmarkResult'
extract_pkgs(x)

Arguments

x

(any)
Object with package information (or a list of such objects).

...

(any)
Additional arguments passed down to remotes::install_cran() or remotes::install_github(). Arguments force and upgrade are often important in this context.

Details

If a package contains a forward slash ('/'), it is assumed to be a package hosted on GitHub in "<user>/<repo>" format, and the string will be passed to remotes::install_github(). Otherwise, the package name will be passed to remotes::install_cran().

Value

extract_pkgs() returns a character() of package strings, install_pkgs() returns the names of extracted packages invisibly.

Examples

1
extract_pkgs(lrns(c("regr.rpart", "regr.featureless")))

mlr3 documentation built on Jan. 19, 2022, 5:08 p.m.