无法从R调用cygwin命令 [英] Can't call cygwin commands from R

查看:207
本文介绍了无法从R调用cygwin命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows框中工作,并使用cygwin模仿unix shell。还有我有R,并想从它运行任何系统命令。我相信 system('command')会这样做,但它不适用于每个'命令 。例如 system('ls')返回 / cygdrive / c / cygwin / bin / ls:写错误:错误的文件描述符我认为这是由于R调用 ls>& - ,它也返回相同的错误。那么如何解决这个问题呢?

解决方案

我希望你仍然对解决方案感兴趣。这里是我有:




  • 从Windows启动R并通过路径调用cygwin可执行: /cygwin/bin/ls.exe');

  • 从cygwin内启动R:

    • 开始cygwin

    • 设置路径: export PATH =$ PATH:/cygdrive/c/Programme/R-2.9.2/bin

    • 调用R: Rgui.exe

    • 调用shell:系统('ls')




<



Martin。


I'm working in windows box, and using cygwin to imitate unix 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.

这篇关于无法从R调用cygwin命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆