Skip to content
Prev 40313 / 63421 Next

Calling Rscript from Makevars

On May 20, 2011, at 12:04 PM, Martyn Byng wrote:

            
That's all pretty much unnecessary since all settings carry over from the R invocation and also it is what causes your error (since your "arch" is wrong). On unix it's as simple as

PKG_LIBS=`${R_HOME}/bin/Rscript -e 'whatever.you.meant.to.run()'`

and on Windows it's

PKG_LIBS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e 'whatever.you.meant.to.run()'`

Note that you should NOT mess with the environment variables that R uses as you're likely to set them incorrectly.

Cheers,
Simon