build-tools: Build Tools

Description Usage Arguments Details Note

Description

Check, install, and use build tools as required.

Usage

1
2
3
4
5

Arguments

action

The action (as a string) being taken that will require installation of build tools.

expr

An R expression (unquoted) to be executed with build tools available and on the PATH.

Details

These functions are intended to be used together – one should first check whether build tools are available, and when not, prompt for installation. For example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
compile_model <- function(...) {

if (rstudioapi::isAvailable()) {

if (!rstudioapi::buildToolsCheck())
      rstudioapi::buildToolsInstall("Model compilation")

rstudioapi::buildToolsExec({
      # code requiring build tools here
    })

}
}

The action parameter is used to communicate (with a prompt) the operation being performed that requires build tool installation. Setting it to NULL or the empty string will suppress that prompt.

Note

The buildToolsCheck(), buildToolsInstall(), and buildToolsExec() functions were added with version 1.2.962 of RStudio.


rstudio/rstudioapi documentation built on June 7, 2019, 3:43 p.m.