简体   繁体   English

system2在R中运行

[英]system2 functioning in R

When I run a batch file through system2 in R: 当我通过R中的system2运行批处理文件时:

The following runs the batch file without any issue: 以下运行批处理文件没有任何问题:

system2("Run.bat")

However, this one gives an error: 但是,这给出了一个错误:

system2("Run", stdout=stdout, stderr=stderr)
Warning message:
running command '"Run.bat"' had status 1 

Any insights on what might be causing this? 关于什么可能导致此的任何见解?

Read the documentation carefully: 仔细阅读文档

stdout , stderr where output to 'stdout' or 'stderr' should be sent. stdoutstderr应将输出发送到“ stdout”或“ stderr”。 Possible values are "", to the R console (the default), NULL or FALSE (discard output), TRUE (capture the output in a character vector) or a character string naming a file. 对于R控制台(默认值),可能的值为“”,NULL或FALSE(丢弃输出),TRUE(将输出捕获到字符向量中)或命名文件的字符串。

Seems like you need to specify those arguments as character strings. 似乎您需要将这些参数指定为字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM