Description Usage Arguments Details See Also
View source: R/ProcessFunctions.R
This function is used finish a R script run by a RProcess module such as RProcess
.
It should be the last command of the script since it writes an output file, tells the shiny session about it,
and ends the R session with a call to quit
.
1 2 | Rscript_Fin(output, log = paste("Process finishes at", Sys.time()),
info = NULL)
|
output |
object which will be handed over back to shiny session |
log |
|
info |
ProcessInfo object or |
The output will overwrite the input file used by the same R script.
By setting progress to 1 in the *.status
file, the shiny session knows that this R script has finished.
It will then read the output file.
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.
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_Init
,
Rscript_Log
, Rscript_Start
,
Rscript_Try
, Rscript_Up
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.