I am trying to run an R script that is in the same directory as the python script while executing the python script.
So far, I have:
if condition is True:
import subprocess
subprocess.call (["C:/Program Files/R/R-3.4.3/Rscript", "./testing.r"])
sys.exit()
I keep getting the error:
OSError: [WinError 193] %1 is not a valid Win32 application
I've tried replacing "C:/Program Files/R/R-3.4.3/Rscript" with "/usr/bin/Rscript" but keep getting the same error. I was wondering if anybody would know why it keeps throwing this error?
subprocess.call(['C:/Program Files/R/R-3.4.3/Rscript', '--vanilla', 'testing.r'], shell = True)or provide the full path to the R script filetesting.r, so 'C:/full/absolute/path/to/testing.r' (or is it in 'D:/' even)?