make_with_dir {makepipe} | R Documentation |
Create a pipeline using roxygen tags
Description
Instead of maintaining a separate pipeline script containing calls to
make_with_source()
, you can add roxygen-like headers to the .R files in
your pipeline containing the @makepipe
tag along with @targets
,
@dependencies
, and so on. These tags will be parsed by make_with_dir()
and used to construct a pipeline. You can call a specific part of the
pipeline that has been documented in this way using make_with_roxy()
.
Usage
make_with_dir(
dir = ".",
recursive = FALSE,
build = TRUE,
envir = new.env(parent = parent.frame()),
quiet = getOption("makepipe.quiet")
)
make_with_roxy(
source,
envir = new.env(parent = parent.frame()),
quiet = getOption("makepipe.quiet")
)
Arguments
dir |
A character vector of full path names; the default corresponds to the working directory |
recursive |
A logical determining whether or not to recurse into subdirectories |
build |
A logical determining whether or not the pipeline will be built immediately or simply returned to the user |
envir |
The environment in which to execute the |
quiet |
A logical determining whether or not messages are signaled |
source |
The path to an R script which makes the |
Details
Other than @makepipe
, which is used to tell whether a given script should
be included in the pipeline, the tags recognised mirror the arguments to
make_with_source()
. In particular,
-
@targets
and@dependencies
are for declaring inputs and outputs, the expected format is a comma separated list of strings like@targets "out1.Rds", "out2.Rds"
but R code like@targets file.path(DIR, "out.Rds")
(evaluated inenvir
) works too -
@packages
is for declaring the packages that the targets depend on, the expected format is@packages pkg1 pkg2 etc
-
@force
is for declaring whether or not execution should be forced, the expected format is a logical likeTRUE
orFALSE
See the getting started vignette for more information.
Value
A Pipeline
object
See Also
Other make:
make_with_recipe()
,
make_with_source()
Examples
## Not run:
# Create a pipeline from scripts in the working dir without executing it
p <- make_with_dir(build = FALSE)
p$build() # Then execute it yourself
## End(Not run)