Run the executable in R script

Is there a way to run the executable from R and write its output?

As an example:

output <- run_exe("my.exe")
+5
source share
1 answer

Yes, look at system()its parameters. Hence

R> res <- system("echo 4/3 | bc -l", intern=TRUE)
R> res
[1] "1.33333333333333333333"
R> 

would be one way to split four into three if you don't trust the R engine itself.

+7
source

All Articles