r.bot
r.bot

Reputation: 5424

Source R script using 32 bit R from 64 bit RStudio

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.

Upvotes: 10

Views: 4283

Answers (1)

TARehman
TARehman

Reputation: 6749

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.

Upvotes: 9

Related Questions