Calling r.("quit()") from robjects closes the python process as well

184 views Asked by At

I'm using robjects to execute an R script from python. When R finishes it leaves behind it many temporary files. I can't modify the R script but I also don't see there any reference to tempfile() so I assume it is coming from a library the R script is using. I tried deleting these files from python at the end of the script run but they are locked by some process. I assumed that if there is a live R interpreter running, closing it will release these files. I tried calling robject.r("quit()") but that killed my python process as well. Any ideas why? How can I close only the R interpreter from robjects? I prefer not to kill the R interpreter using the OS.

0

There are 0 answers