View source: R/sysargslist_utilities.R
writeTargets | R Documentation |
SYSargsList
Convenience write function for generating targets files containing the paths to
files generated by input processes. These processes can be commandline-
or R-based software. Typically, the paths to the inputs are stored in the
targets infile targetsWF(sysargs)
for SYSargsList
objects.
Note: by default the function cannot overwrite any existing files. If a file
exists then the user has to explicitly remove it or set overwrite=TRUE
.
writeTargets(sysargs, step, file = "default", silent = FALSE, overwrite = FALSE)
sysargs |
Object of class |
step |
character with the step name. To check all the names, please
use |
file |
Name and path of the output file. If set to "default" then the name of the output file will have the pattern 'targets_<stepName>.txt'. |
silent |
If set to |
overwrite |
If set to |
Writes tabular targes files containing the header/comment lines from
stepsWF(sysargs)[[step]][["targetsheader"]]
and the
columns from targetsWF(sysargs)[[step]]
.
Daniela Cassol
## Construct SYSargsList object from Rmd file
sal <- SPRproject(overwrite=TRUE)
targetspath <- system.file("extdata/cwl/example/targets_example.txt", package="systemPipeR")
## Constructor and `appendStep<-`
appendStep(sal) <- SYSargsList(step_name = "echo",
targets=targetspath, dir=TRUE,
wf_file="example/workflow_example.cwl", input_file="example/example.yml",
dir_path = system.file("extdata/cwl", package="systemPipeR"),
inputvars = c(Message = "_STRING_", SampleName = "_SAMPLE_"))
appendStep(sal) <- LineWise(code = {
hello <- lapply(getColumn(sal, step=1, 'outfiles'), function(x) yaml::read_yaml(x))
},
step_name = "R_read",
dependency = "echo")
writeTargets(sal, "echo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.