I try to run R script via a python GUI.
Under R console, I installed the rgl package. In windows-7, R install packages under the current user folder, not the ProgramFiles\R... folder.
I have a simple demo.r
script:
library('rgl')
example('plot3d')
If I run demo.r script using the newly installed rgl package with the following command line:
"c:\ProgramFiles\R\R..\bin\Rscript.exe" demo.r
It works perfectly!
Now, if I run it from python with the following script:
import subprocess
out = subprocess.check_output([r"c:\ProgramFiles\R\R..\bin\Rscript.exe", "demo.r"])
I get an error telling that rgl is not found/installed.
I checked that if my demo.r contains only a simple print to screen command, it works. This means that when launch from python, Rscript.exe do not know anymore where to find rgl package under the user folder.
If I copy the rgl package folder from the user folder to the ProgramFiles\R... folder, then it works.
Does anybody knows how I can specify make python running the R script and using the package from the user folder?
Thanks