0

When I run a batch file through system2 in R:

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?

user308827
  • 21,227
  • 87
  • 254
  • 417

1 Answers1

3

Read the documentation carefully:

stdout, stderr where output to ‘stdout’ or ‘stderr’ should be sent. 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.

Seems like you need to specify those arguments as character strings.

Thomas
  • 43,637
  • 12
  • 109
  • 140