假設我想運行的功能運行v功能與32位R參數,內部的64位R
test.function <- function(arg1){
print(arg1)
}
如何運行,讓說:
在32位模式下test.function("Hello world")
,使用64位R?我已成功使用
system(paste0(Sys.getenv("R_HOME"), "/bin/i386/Rscript.exe ",'"some_script.R"'))
但在32位模式下運行的整個腳本如何我可以改變這一點,以便它可以運行參數的函數,而不是整個腳本?
編輯
繼羅馬Luštrik答案和運行
system('Rscript test.script.R "hello"')
使我有以下錯誤:
Error in winDialog(type = "ok", message = message_text) : winDialog() cannot be used non-interactively call: -> check.for.updates.R -> winDialog Running stopped
Warning message: running command 'Rscript test.script.R "hello"' had status 1
(該錯誤消息是我的母語,所以我有翻譯幾句話,所以文字可能在其他系統上略有不同)
你可以把這一行放到你的函數中嗎? – AK47
可能是可行的,但我還沒有進一步,比運行整個腳本,所以我不知道它應該怎麼做 – Acarbalacar
你的編輯看起來應該是一個新的問題。無論如何,你可能正在使用一些不會非交互式使用的函數。 –