I am having trouble with PhantomJS and I have managed to whittle it down to Sys.which()
. Searching for PhantomJS using Sys.which("phantom")
does not return any results. However,when I check my PATH I get:
> Sys.getenv("PATH")
[1] "C:\\Program Files\\R\\R-3.2.0\\bin\\x64;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Windows Live\\Shared;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Calibre2\\;C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\;C:\\Go\\bin;C:\\Program Files\\Mercurial\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Skype\\Phone\\;\"C:\\Program Files\\phantomjs-2.1.1-windows\\bin\";C:\\Rtools\\bin"
When I afterwards add:
Sys.setenv(PATH=paste(Sys.getenv("PATH"),"C:\\Program Files\\phantomjs-2.1.1-windows\\bin\\",sep=";"))
Now I get the right result. Why does it not work in the previous instance?