开发者

Run an executable in R script

开发者 https://www.devze.com 2023-02-19 02:36 出处:网络
Is there a way to开发者_JAVA技巧 run an executable from R and capture its output? As an example: output <- run_exe(\"my.exe\")

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消