[R-sig-Geo] shell command on Windows 7

Wall, Wade A ERDC-RDE-CERL-IL Wade.A.Wall at usace.army.mil
Wed Dec 18 20:42:24 CET 2013


Hi all,

I am trying to run the script located at http://geomorphometry.org/content/geomorphometry-r-saga-ilwis-grass to integrate R, SAGA, ILWIS, and GRASS, but I am getting error messages when I try to use the shell() command.

The relevant lines of code are:

ILWIS <- "C:\\Progra~1\\N52\\Ilwis35\\IlwisClient.exe -C"
shell(cmd=paste(ILWIS, "setcsy dem25m.grf gk_6.csy -force"), wait=F)

When I try to run these two commands, I get the error message (when I leave out "wait=F")

1: running command 'C:\Windows\system32\cmd.exe /c C:\Program Files (x86)\N52\Ilwis35\IlwisClient.exe setcsy dem25m.grf gk_6.csy -force' had status 1 
2: In shell(cmd = paste(ILWIS, "setcsy dem25m.grf gk_6.csy -force")) :
  'C:\Program Files (x86)\N52\Ilwis35\IlwisClient.exe setcsy dem25m.grf gk_6.csy -force' execution failed with error code 1

I have changed the path in the object ILWIS to "C:\\Program Files (x86)\\ . . . .exe -C" and included quotation marks, as one might do when using cmd.exe

I can get shell.exec to work, but only to open ILWIS. 

If I try to run another program, for example Python 2.7 that resides on the C drive, (C:\Python27\python.exe), I can use the shell command, but it does not open inside cmd.exe, but rather in the R workspace. Then it stops and I am back at the command prompt.

Has anyone else had this problem using Windows 7?

Wade A. Wall
US Army ERDC-CERL
P.O. Box 9005
Champaign, IL  61826-9005
1-217-373-4420
Wade.A.Wall at usace.army.mil



More information about the R-sig-Geo mailing list