Rscript_Abort: Rscript_Abort

Description Usage Arguments Details See Also

View source: R/ProcessFunctions.R

Description

This function is used to terminate a R script run by a RProcess module such as RProcess. It will send a error message to the shiny session and end the R session with quit. This way it can be used to make quality checks before handing data back to the shiny session.

Usage

1
Rscript_Abort(status, log = c("Process aborts:", status), info = NULL)

Arguments

status

chr of status, which will be rendered as error message in the shiny session

log

chr arr used as log entry if a log file exists (c("Process aborts:", status)). Each element is 1 line.

info

ProcessInfo object or NULL (NULL). This is a list of relevant information about the process. It can be created with Rscript_Init. If NULL the global environment is searched for an object of class ProcessInfo.

Details

As in Rscript_Fin progress in the *.status file is set to 1, signalling the shiny session that the script has finished. However, the status parameter in this file is filled with an error message. The shiny session will not read the output of the R script but instead render the error message.

For correct communication with the shiny session an ProcessInfo object given (argument info). If a log file exists, it is appended with the message given in argument log. Each element is a line. If a session id exists the log 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.

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_Fin, Rscript_Init, Rscript_Log, Rscript_Start, Rscript_Try, Rscript_Up


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