diff options
author | prashantsinalkar | 2019-07-05 18:11:09 +0530 |
---|---|---|
committer | prashantsinalkar | 2019-07-05 18:11:09 +0530 |
commit | cf4f98aa562af951f539a74df47ef332c9186744 (patch) | |
tree | 26ebfe0124e6cd24fed5e6e90a737be715d405f8 | |
parent | 70b9ea3f66a7256695ba669cac8d59b515915832 (diff) | |
download | R_on_Cloud_Web_API-cf4f98aa562af951f539a74df47ef332c9186744.tar.gz R_on_Cloud_Web_API-cf4f98aa562af951f539a74df47ef332c9186744.tar.bz2 R_on_Cloud_Web_API-cf4f98aa562af951f539a74df47ef332c9186744.zip |
added save path for plot
-rw-r--r-- | plumber.R | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -32,7 +32,10 @@ function(code="", session_id="") OutputFile <- paste("/tmp/",session_id,"/",session_id,".txt", sep="") RunInputFile <- paste("Rscript", InputFile, sep=" ") fileConn<-file(InputFile) - writeLines(code, fileConn) + Line1 = paste("png('/tmp/",session_id,".png')\n", sep="") + Line2 = code + Line3 = "while (!is.null(dev.list())) dev.off()" + writeLines(c(Line1, Line2, Line3), fileConn) close(fileConn) #ro <- system(RunInputFile, intern = TRUE) ro <-robust.system(RunInputFile) |