On Win7 I have both 32 bit and 64 bit R installed. Because one can't ODBC to 32 bit MS Access from 64 bit R, I want to source an R script using the 32 bit version of R. From this SO question I understand that I can launch 32 bit R using system()
with
system(paste0(Sys.getenv("R_HOME"), "/bin/i386/R.exe"), wait = FALSE, invisible = FALSE)
This launches R in a terminal. Is it also possible to source an R script from a system()
call?
I wondered whether R CMD BATCH would be a possibility, but I can't see a way to set it to 32 bit R.
I think you want to use Rscript.exe
to run the file, rather than R.exe
. You can do this by just using /bin/i386/Rscript.exe your_rfile.R
- this is how I would execute R code from the command line in Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With