使用来自 64 位 RStudio 的 32 位 R 的源 R 脚本 [英] Source R script using 32 bit R from 64 bit RStudio
问题描述
在 Win7 上,我安装了 32 位和 64 位 R.因为不能从 64 位 R ODBC 到 32 位 MS Access,所以我想使用 32 位版本的 R 来获取 R 脚本.来自 this SO question 我知道我可以使用 system()<启动 32 位 R/code> 与
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)
这会在终端中启动 R.是否也可以从 system()
调用中获取 R 脚本?
This launches R in a terminal. Is it also possible to source an R script from a system()
call?
我想知道 R CMD BATCH 是否可行,但我看不到将其设置为 32 位 R 的方法.
I wondered whether R CMD BATCH would be a possibility, but I can't see a way to set it to 32 bit R.
推荐答案
我认为您想使用 Rscript.exe
来运行文件,而不是 R.exe
.您只需使用 /bin/i386/Rscript.exe your_rfile.R
即可完成此操作 - 这就是我在 Windows 中从命令行执行 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.
这篇关于使用来自 64 位 RStudio 的 32 位 R 的源 R 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!