I have a weird problem with the system() command when issued from within RStudio. The command works just fine if it is issued by R run with xemacs&ess, as well as command-line R. However, the exact same command does not work if I use RStudio.
sh: fslview: command not found
Similar problem when I use the absolute path:
/usr/local/fsl/bin/fslview: line 6: /bin/fslview.app/Contents/MacOS/fslview: No such file or directory
Note the difference between the path in the system call, and the one returned in the error message.
Just to reiterate, this is not an issue of me using the wrong path, because the same command works from any other R prompt that is not mediated through RStudio, as well as from within the shell. Further, it is not a general issue with system(): the command:
works just fine even from within RStudio.
I have observed the same problem in mac OSX 10.7, 10.8, as well as in Ubuntu and other linux distributions.
Any help is greatly appreciated.