According to manual, the stdout argument to system2 can redirect output to a file. This seems to work on unix, however I cannot get it to work with windows. Below is an example of toys, there are no out.txt or err.txt . I tried sending it to an existing file or expanding the full path to the file, but without 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 ?
r stdout cran devtools
Jeroen Jul 14 '13 at 9:19 2013-07-14 09:19
source share