File: build-tools.Rd

package info (click to toggle)
r-cran-rstudioapi 0.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 592 kB
  • sloc: makefile: 2
file content (51 lines) | stat: -rw-r--r-- 1,378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build-tools.R
\name{build-tools}
\alias{build-tools}
\alias{buildToolsCheck}
\alias{buildToolsInstall}
\alias{buildToolsExec}
\title{Build Tools}
\usage{
buildToolsCheck()

buildToolsInstall(action)

buildToolsExec(expr)
}
\arguments{
\item{action}{The action (as a string) being taken that will require
installation of build tools.}

\item{expr}{An \R expression (unquoted) to be executed with build tools
available and on the \code{PATH}.}
}
\description{
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:\preformatted{compile_model <- function(...) {

if (rstudioapi::isAvailable()) {

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

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

}
}
}

The \code{action} parameter is used to communicate (with a prompt) the operation
being performed that requires build tool installation. Setting it to \code{NULL}
or the empty string will suppress that prompt.
}
\note{
The \code{buildToolsCheck()}, \code{buildToolsInstall()}, and \code{buildToolsExec()}
functions were added with version 1.2.962 of RStudio.
}