Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source R script using 32 bit R from 64 bit RStudio

Tags:

r

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.

like image 702
r.bot Avatar asked May 07 '15 15:05

r.bot


1 Answers

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.

like image 111
TARehman Avatar answered Sep 29 '22 10:09

TARehman