Run an executable in R script
Is there a way to开发者_JAVA技巧 run an executable from R and capture its output?
As an example:
output <- run_exe("my.exe")
Yes, look at system()
and its options. Hence
R> res <- system("echo 4/3 | bc -l", intern=TRUE)
R> res
[1] "1.33333333333333333333"
R>
would be one way to divide four by three in case you mistrust the R engine itself.
精彩评论