Skip to contents

Build packages and commit to drat repo

Usage

drat(
  package = getwd(),
  repo = file.path("~", "monorepo", "r-acidgenomics-com"),
  check = TRUE,
  tag = TRUE,
  pkgdown = TRUE,
  deploy = TRUE
)

Arguments

package

character. Directory paths to R package source code. Vectorized, supporting the building of multiple packages in a single call.

repo

character(1). Directory path to local R drat repository (e.g. "r-acidgenomics-com").

check

logical(1). Perform package checks prior to building package.

tag

logical(1). Tag release on GitHub.

pkgdown

logical(1). Build pkgdown website, if supported.

deploy

logical(1). Deploy (push) the drat repo to AWS S3.

Value

logical(1). Boolean, indicating if drat build was successful.

Note

Updated 2022-05-23.

Building from the command line

R CMD build ~/monorepo/r-packages/r-syntactic
R CMD INSTALL --build syntactic_0.5.2.tar.gz
R CMD check --as-cran syntactic_0.5.2.tar.gz
# How to install from source:
R CMD INSTALL syntactic_0.5.2.tar.gz
# Or how to install binary (on macOS).
R CMD INSTALL syntactic_0.5.2.tgz

Building vignettes

If you run into problems with a vignette index not being detected, make sure the .Rbuildignore file does not contain ^vignettes$. Ignoring ^Meta$ and ^doc$ is acceptable though.

Note that devtools::build currently doesn't handle building vignettes for binary packages correctly.

See also

  • https://seandavi.github.io/post/build-linux-r-binary-packages/

  • https://rstudio.github.io/r-manuals/r-exts/Creating-R-packages.html

Examples

## > drat(
## >     package = file.path(
## >         "~",
## >         "monorepo",
## >         "r-packages",
## >         c(
## >             "r-acidbase",
## >             "r-basejump",
## >             "r-koopa"
## >         )
## >     )
## > )