1

Say I have a basic r script:

require(gWidgets2RGtk2)
w<-gbasicdialog("Stage 1.5")
visible(w)

I save it, and attempt to run it with command prompt using a batch file that looks like this:

@echo
"C:\Program Files\R\R-3.0.2\bin\x64\Rscript.exe" "C:\Users\Me\Desktop\test\test.r"
PAUSE

When I attempt to run this script, I get this error after all the packages are loaded:

Error in UseMethod(".gbasicdialog") :
  no applicable method for '.gbasicdialog'applied to an object of class "NULL"
Calls: gbasicdialog -> .gbasicdialog
Execution halted

Can anyone see if I am doing anything wrong?

4

1 回答 1

1

将脚本更改为:

options(guiToolkit="RGtk2")
library(gWidgets2)
w <- gbasicdialog("Stage 1.5")
visible(w)

另外我假设您的意思@echo off是批处理文件中的第一行。该PAUSE语句可以省略。

于 2014-02-17T04:36:32.667 回答