Rscript_Init: Rscript_Init

Description Usage Arguments Details Value See Also

View source: R/ProcessFunctions.R

Description

This function is used to read a *.status file and load the input for a R script which was started by a RProcess module such as RProcess. This should be the first command of the R script.

Usage

1
2
Rscript_Init(args = commandArgs(TRUE), log = paste("Starting at",
  Sys.time()))

Arguments

args

chr of path to *.status file (commandArgs(TRUE)). If the R script was started using RProcess module, this is the first trailing argument of Rscript (default).

log

chr arr used as initial log entry for this process (paste("Starting at", Sys.time())). Each element is a line.

Details

The function returns the object handed over by the RProcess module it was started with. It also writes a list info of class ProcessInfo into the global environment which is used by all other Rscript communication functions. This list contains information needed to correctly communicate with the shiny session.

If a log file exists, it is appended by the lines defined with log. Each element of log is a line. Information about path of the log file, the session id and the process id is taken from the ProcessInfo object. If a session id exists, every line is prefixed with it. If a process id exists, before writing anything the loaded process id is compared with the current one – read from the *.status file. If they do not match the R session ends with a call to quit. This ensures that, in case a newer version of the same process is running, the current one will quit and not overwrite anything.

Value

input object as handed over from the RProcess module As a side effect an object info of class ProcessInfo is written into the global environment. This is a list which contains information about the current process. It is used by all Rscript communication functions.

See Also

These Rscript communication functions are used in R scripts started by a RProcess module such as RProcess. For some examples on how they work together see the vignette RProcess Module Functions.

Other Rscript communication functions: ReadInfo, Rscript_Abort, Rscript_Fin, Rscript_Log, Rscript_Start, Rscript_Try, Rscript_Up


mRcSchwering/shinyTools documentation built on May 21, 2019, 10:14 a.m.