Question

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?

Was it helpful?

Solution

Change the script to this:

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

Also I assume you meant @echo off as the first line in the batch file. The PAUSE statement could be omitted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top