package_build: Pre-process, document and build a data package

Description Usage Arguments Examples

View source: R/build.R

Description

Combines the preprocessing, documentation, and build steps into one.

Usage

1
2
3
4
5
6
7
8
package_build(
  packageName = NULL,
  vignettes = FALSE,
  log = INFO,
  deps = TRUE,
  install = FALSE,
  ...
)

Arguments

packageName

character path to package source directory. Defaults to the current path when NULL.

vignettes

logical specify whether to build vignettes. Default FALSE.

log

log level INFO,WARN,DEBUG,FATAL

deps

logical should we pass data objects into subsequent scripts? Default TRUE

install

logical automatically install and load the package after building. (default TRUE)

...

additional arguments passed to install.packages when install=TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if(rmarkdown::pandoc_available()){
f <- tempdir()
f <- file.path(f,"foo.Rmd")
con <- file(f)
writeLines("```{r}\n tbl = table(sample(1:10,1000,replace=TRUE)) \n```\n",con=con)
close(con)
pname <- basename(tempfile())
datapackage_skeleton(name=pname,
   path=tempdir(),
   force = TRUE,
   r_object_names = "tbl",
   code_files = f)

package_build(file.path(tempdir(),pname), install = FALSE)
}

DataPackageR documentation built on March 17, 2021, 5:07 p.m.