Builds the R package on pkg_root by:

  • styling the R scripts and R Markdown files,

  • building package data by running R scripts stored in data_raw,

  • rendering the R scripts and R Markdown files using rmarkdown::render(), and

  • building pkgdown site.

pkg_build(
  pkg_root = getwd(),
  clean = TRUE,
  minimal = FALSE,
  style = TRUE,
  data = FALSE,
  render = TRUE,
  readme = TRUE,
  vignettes = TRUE,
  tests = TRUE,
  tests2vignettes = TRUE,
  pkgdown = TRUE,
  par = FALSE,
  ncores = NULL,
  git = FALSE,
  github = FALSE,
  commit_msg = "BUILD"
)

Arguments

pkg_root

Character string. Package root directory.

clean

Logical. Clean output that were automatically generated by previous builds before initiating the current build. See pkg_clean() for details.

minimal

Logical. If TRUE, minimal check, build, and install using R CMD will be performed, ignoring all the other function arguments. If FALSE, a more thorough check is performed with additional options. See pkg_build_minimal() for details.

style

Logical. Style R scripts and R Markdown files. See pkg_style() for details.

data

Logical. Generate data from data_raw. See pkg_data_raw() for details.

render

Logical. Render R scripts and R Markdown files. See pkg_render() for details.

readme

Logical. Render README.Rmd. Ignored if render = FALSE.

vignettes

Logical. Render vignettes/*.Rmd. Ignored if render = FALSE.

tests

Logical. Render tests/testhat/*.R. Ignored if render = FALSE.

tests2vignettes

Logical. Copy and spin tests/testhat/*.R to vignettes/tests/*.Rmd. It is assumed that tests/testhat/*.R are written using Roxygen comments. See pkg_tests2vignettes() for details.

pkgdown

Logical. Build pkgdown site.

par

Logical. If TRUE, use multiple cores.

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

git

Logical. Set up a git repository.

github

Logical. Set up and push to a github repository.

commit_msg

Character string. Git commit message.

Author

Ivan Jacob Agaloos Pesigan

Examples

if (FALSE) { pkg_build( pkg_root = "~/boilerplatePackage", minimal = TRUE ) }