LineWise-class | R Documentation |
"LineWise"
S4 class container for storing R-based code for a workflow step.
LineWise class
instances are constructed by the LineWise
function,
based on the R-based code, step name, and dependency tree.
When the container is built from the R Markdown, using importWF
function, two other slots are populated: codeChunkStart
and rmdPath
.
codeChunkStart
will store the first line of each R chunk, and rmdPath
will store the R Markdown file path.
## Constructor
LineWise(code, step_name = "default", codeChunkStart = integer(),
rmdPath = character(), dependency="",
run_step = "mandatory",
run_session = "management",
run_remote_resources = NULL)
code |
R code separated either by a semi-colon ( |
step_name |
character. Step name needs to be unique and is required when appending this step to the workflow. |
codeChunkStart |
integer. R Markdown code chunk line start. This element will be populated when
the object is built by |
rmdPath |
character. Path of R Markdown file used by |
dependency |
character. Dependency tree, required when appending this step to
the workflow. Character name of a previous step in the workflow.
Default is empty string |
run_step |
character. If the step has "mandatory" or "optional" flag for the execution. |
run_session |
character. If the step has "management" or "compute" flag for the execution. |
run_remote_resources |
|
Objects can be created by calls of the form new("LineWise", ...)
.
codeLine
:Object of class "expression"
storing R-based
code.
codeChunkStart
:Object of class "interger"
storing start
line from the rmdPath
file, when the
"LineWise"
is built from R Markdown.
stepName
:Object of class "character"
storing step name.
dependency
:Object of class "list"
storing dependency
tree.
status
:Object of class "list"
storing status steps.
files
:Object of class "list"
storing file for
R Markdown file and the file containing
stdout and stderr after running the R-based code.
runInfo
:Object of class "list"
storing all the
runInfo
information of the workflow
See 'Usage' for details on invocation.
Constructor:
Returns a LineWise
object.
Accessors:
Printing method for the CodeLine
slot.
Extract start line of the R Markdown R chunk.
Extract Rmarkdown file path.
Extract the step name.
Extract the dependency tree.
Extract status of the step.
Extract log file path storing stdout and stderr after running step.
Replacement method for append a R code line.
Replacement method for replace a R code line.
Methods:
Return a new LineWise
object made of the selected R code lines.
Extract the slot information from LineWine
object.
Replacement method for LineWine
slots.
Extract slots elements by name.
Extract number of R-based code lines.
Extract slot names.
Summary view of LineWise
elements.
signature(from = "LineWise", to = "list")
as(LineWise, "list")
signature(from = "list", to = "LineWise")
as(list, "LineWise")
Coerce back to list as(LineWise, "list")
Daniela Cassol
SYSargsList
showClass("LineWise")
lw <- LineWise(code = {
log_out <- log(10)
},
step_name = "R_log")
codeLine(lw)
## ImportWF option
file_path <- system.file("extdata/spr_simple_lw.Rmd", package="systemPipeR")
sal <- SPRproject(overwrite = TRUE)
# file_path <- "../inst/extdata/spr_simple_lw.Rmd"
sal <- importWF(sal, file_path)
sal <- runWF(sal)
lw2 <- sal$stepsWF[[2]]
lw2
names(lw2)
length(lw2)
## Accessors
codeLine(lw2)
codeChunkStart(lw2)
rmdPath(lw2)
stepName(lw2)
dependency(lw2)
status(lw2)
files(lw2)
## Replacement
appendCodeLine(lw2, after = 0) <- "log <- log(10)"
codeLine(lw2)
replaceCodeLine(lw2, 1) <- "plot(iris)"
codeLine(lw2)
## Coerce
lw2 <- linewise(lw2) ## OR lw2 <- as(lw2, "list")
lw2 <- as(lw2, "LineWise")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.