Check, install, and use build tools as required.
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:
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.