Can't call cygwin commands from R
I'm working in windows box, and using cygwin to imitate unix 开发者_Go百科shell. Also I have R and want to run any system comand from it. I believe that system('command')
would do this, but it didn't work for each 'command'
. For example system('ls')
returns /cygdrive/c/cygwin/bin/ls: write error: Bad file descriptor
and I think that this is beacause R calls ls >& -
which also returns same error. So how solve this problem?
I hope you are still interested in a solution. Here is what I have:
- Start R from Windows and call cygwin executable by path:
system('C:/cygwin/bin/ls.exe');
- Start R from within cygwin:
- Start cygwin
- Set path:
export PATH="$PATH:/cygdrive/c/Programme/R-2.9.2/bin"
- Call R:
Rgui.exe
- Call shell:
system('ls')
Regards,
Martin.
精彩评论