Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

build

Build package


Description

Building converts a package source directory into a single bundled file. If binary = FALSE this creates a tar.gz package that can be installed on any platform, provided they have a full development environment (although packages without source code can typically be installed out of the box). If binary = TRUE, the package will have a platform specific extension (e.g. .zip for windows), and will only be installable on the current platform, but no development environment is needed.

Usage

build(
  path = ".",
  dest_path = NULL,
  binary = FALSE,
  vignettes = TRUE,
  manual = FALSE,
  clean_doc = NULL,
  args = NULL,
  quiet = FALSE,
  needs_compilation = pkg_has_src(path),
  compile_attributes = FALSE,
  register_routines = FALSE
)

Arguments

path

Path to a package, or within a package.

dest_path

path in which to produce package. If NULL, defaults to the parent directory of the package.

binary

Produce a binary (--binary) or source ( --no-manual --no-resave-data) version of the package.

vignettes, manual

For source packages: if FALSE, don't build PDF vignettes (--no-build-vignettes) or manual (--no-manual).

clean_doc

If TRUE, clean the files in inst/doc before building the package. If NULL and interactive, ask to remove the files prior to cleaning. In most cases cleaning the files is the correct behavior to avoid stale vignette outputs in the built package.

args

An optional character vector of additional command line arguments to be passed to R CMD build if binary = FALSE, or R CMD install if binary = TRUE.

quiet

if TRUE suppresses output from this function.

needs_compilation

Usually only needed if the packages has C/C++/Fortran code. By default this is autodetected.

compile_attributes

if TRUE and the package uses Rcpp, call Rcpp::compileAttributes() before building the package. It is ignored if package does not need compilation.

register_routines

if TRUE and the package does not use Rcpp, call register routines with tools::package_native_routine_registration_skeleton() before building the package. It is ignored if package does not need compilation.

Value

a string giving the location (including file name) of the built package


pkgbuild

Find Tools Needed to Build R Packages

v1.2.0
MIT + file LICENSE
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.