The Rmd or R file or directory specified by file will be moved into the data-raw directory. It will also be added to the yml configuration file. Any existing file by that name will be overwritten when overwrite is set to TRUE

use_processing_script(
  file = NULL,
  title = NULL,
  author = NULL,
  overwrite = FALSE
)

Arguments

file

character path to an existing file or name of a new R or Rmd file to create.

title

character title of the processing script for the yaml header. Used only if file is being created.

author

character author name for the yaml header. Used only if the file is being created.

overwrite

logical default FALSE. Overwrite existing file of the same name.

Value

invisibly returns TRUE for success. Stops on failure.

Examples

if(rmarkdown::pandoc_available()){ myfile <- tempfile() file <- system.file("extdata", "tests", "extra.rmd", package = "DataPackageR") datapackage_skeleton( name = "datatest", path = tempdir(), code_files = file, force = TRUE, r_object_names = "data") use_processing_script(file = "newScript.Rmd", title = "Processing a new dataset", author = "Y.N. Here.") }
#> Creating '/tmp/RtmpiNi3uS/datatest/'
#> Setting active project to '/tmp/RtmpiNi3uS/datatest'
#> Creating 'R/'
#> Writing 'DESCRIPTION'
#> Package: datatest #> 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/test'
#> Setting active project to '/tmp/RtmpiNi3uS/datatest'
#> Added DataVersion string to 'DESCRIPTION'
#> Creating 'data-raw/'
#> Creating 'data/'
#> Creating 'inst/extdata/'
#> Copied extra.rmd into 'data-raw' #> configured 'datapackager.yml' file
#> Warning: path[1]="/tmp/RtmpiNi3uS/datatest/data-raw/newScript.Rmd": No such file or directory
#> Attempting to create newScript.Rmdconfiguration: #> files: #> extra.rmd: #> enabled: yes #> newScript.Rmd: #> enabled: yes #> objects: data #> render_root: #> tmp: '545489'