gpt4 book ai didi

R 系统函数总是返回错误 127

转载 作者:行者123 更新时间:2023-12-04 00:38:01 30 4
gpt4 key购买 nike

我需要从 执行外部工具R 该工具中发生了过程错误(如果有)。
我知道 3 个函数可以做一些熟悉我的任务的东西:

shell, system and system2.

试图测试这些,我看到了那个命令
shell("notepad") 

打开记事本。据我所知,shell 不允许检查错误(没有界面可以查看 stderr )。

当我打电话
system("notepad")

或者
system2("notepad") 

R 卡住尝试发出这些命令。

打电话
system("start notepad") 

或者
system2("start notepad") 

返回警告
Warning message:
running command '"start notepad"' had status 127

最佳答案

调整@DavidTseng 的答案(抱歉没有足够的声誉来支持它)...

system("cmd.exe", input = "notepad")

在 Windows 中为我工作。

关于R 系统函数总是返回错误 127,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33646816/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com