system2

Redirect system2 stdout to a file on windows

一世执手 提交于 2019-12-31 01:52:07
问题 According to the manual, the stdout argument of the system2 function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no out.txt or err.txt files are created. I tried sending it to an existing file, or expand the full file path, but with no success: setwd(tempdir()) system2("whoami", stdout="out.txt", stderr="err.txt") file.exists("out.txt") Am I doing something wrong or is this a limitation in system2 ? 回答1: I'm

R system or system2 command using paste or sprintf to run bat file?

孤街浪徒 提交于 2019-12-25 01:17:08
问题 I have a bat file that I can run from R using the following system command: system('"C:\\PROGRA~1\\THERMO~1\\AFFYME~1\\APT-12~1.5\\bin\\apt-vars.bat" && cd "C:\\Users\\phyca\\Desktop\\R7\\R7_10-~1" && apt-cel-convert.exe --f text --i --cel-files CEL_FILE.txt') But when I try to automate my whole process, I can't get it to trigger. The line returns without error, but it doesn't trigger the script. #set apt location apt_cnvrt <- "C:/Program Files/Thermo Fisher Scientific/Affymetrix Power Tools

R system functions always returns error 127

做~自己de王妃 提交于 2019-12-17 19:48:17
问题 I need to execute an external tool from R and process errors (if any) occurred in that tool. I know 3 functions to do something familiar with my task: shell, system and system2. Trying to test those, I see that command shell("notepad") opens notepad. As far as I know shell doesn't allow to check errors (there's no interface to look into stderr ). When I call system("notepad") or system2("notepad") R freezes trying to make those commands. Calling system("start notepad") or system2("start

Unable to get R language system2 command result

旧巷老猫 提交于 2019-12-12 07:47:20
问题 i am not able to get the system2 result. tried to execute the sample jar file. execute_system.R: workingDir <- "C:/Code" setwd(workingDir) command <- "java -jar sample.jar 674" commandResult <- system2(command, stdout="C:/Code/stdout.txt", stderr="C:/Code/stderr.txt") cat("commandResult: ", commandResult) I am getting the error message when i execute this execute_system.R file and empty file is generated (stdout.txt, stderr.txt) commandResult: 127 warning message: running command '"java -jar

system2 functioning in R

柔情痞子 提交于 2019-12-12 02:01:14
问题 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? 回答1: 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),

Redirect system2 stdout to a file on windows

两盒软妹~` 提交于 2019-12-01 20:51:22
According to the manual , the stdout argument of the system2 function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no out.txt or err.txt files are created. I tried sending it to an existing file, or expand the full file path, but with no success: setwd(tempdir()) system2("whoami", stdout="out.txt", stderr="err.txt") file.exists("out.txt") Am I doing something wrong or is this a limitation in system2 ? I'm quite convinced now this is a bug in RGui.exe in windows. I filed a bug report here: https://bugs.r-project.org

R system functions always returns error 127

跟風遠走 提交于 2019-11-28 11:01:46
I need to execute an external tool from R and process errors (if any) occurred in that tool. I know 3 functions to do something familiar with my task: shell, system and system2. Trying to test those, I see that command shell("notepad") opens notepad. As far as I know shell doesn't allow to check errors (there's no interface to look into stderr ). When I call system("notepad") or system2("notepad") R freezes trying to make those commands. Calling system("start notepad") or system2("start notepad") returns warning Warning message: running command '"start notepad"' had status 127 Tim Biegeleisen