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

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

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) }
#> Creating '/tmp/RtmpiNi3uS/file4e43d288ea7/'
#> Setting active project to '/tmp/RtmpiNi3uS/file4e43d288ea7'
#> Creating 'R/'
#> Writing 'DESCRIPTION'
#> Package: file4e43d288ea7 #> Title: What the Package Does (One Line, Title Case) #> Version: 0.0.0.9000 #> [email protected] (parsed): #> * First Last <[email protected]> [aut, cre] (YOUR-ORCID-ID) #> Description: What the package does (one paragraph). #> License: `use_mit_license()`, `use_gpl3_license()` or friends to #> pick a license #> Encoding: UTF-8 #> LazyData: true #> Roxygen: list(markdown = TRUE) #> RoxygenNote: 7.1.1
#> Writing 'NAMESPACE'
#> Setting active project to '/tmp/RtmpiNi3uS/file4e43bbe0b84'
#> Setting active project to '/tmp/RtmpiNi3uS/file4e43d288ea7'
#> Added DataVersion string to 'DESCRIPTION'
#> Creating 'data-raw/'
#> Creating 'data/'
#> Creating 'inst/extdata/'
#> Copied foo.Rmd into 'data-raw' #> configured 'datapackager.yml' file #> #> 1 data set(s) created by foo.Rmd #> tbl #> Built all datasets! #> Non-interactive NEWS.md file update. #>
#> Creating 'vignettes/'
#> Creating 'inst/doc/'
#> First time using roxygen2. Upgrading automatically...
#> Loading file4e43d288ea7
#> Writing NAMESPACE #> Writing file4e43d288ea7.Rd #> Writing tbl.Rd #> checking for file ‘/tmp/RtmpiNi3uS/file4e43d288ea7/DESCRIPTION’ ... checking for file ‘/tmp/RtmpiNi3uS/file4e43d288ea7/DESCRIPTION’ #> ─ preparing ‘file4e43d288ea7’: #> checking DESCRIPTION meta-information ... checking DESCRIPTION meta-information #> ─ checking for LF line-endings in source and make files and shell scripts #> ─ checking for empty or unneeded directories #> NB: this package now depends on R (>= 3.5.0) #> WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: ‘file4e43d288ea7/data/tbl.rda’ #> ─ building ‘file4e43d288ea7_1.0.tar.gz’ #> #> Next Steps #> 1. Update your package documentation. #> - Edit the documentation.R file in the package source data-raw subdirectory and update the roxygen markup. #> - Rebuild the package documentation with document() . #> 2. Add your package to source control. #> - Call git init . in the package source root directory. #> - git add the package files. #> - git commit your new package. #> - Set up a github repository for your pacakge. #> - Add the github repository as a remote of your local package repository. #> - git push your local repository to gitub.
#> [1] "/tmp/RtmpiNi3uS/file4e43d288ea7_1.0.tar.gz"