[R] How to use bash command in R script?

Guo Wei-Wei wwguocn at gmail.com
Tue Feb 27 07:05:09 CET 2007


Dear All:

Maybe it is a too basic question, but I don't how to find the answer.
Sorry for that.

What I want to do is call a shell command, which will provide two
numbers, and assign those numbers to a vector. For example:

The following command:

$mxresult.sh ABC.mx

mxresult.sh is a script written by myself and ABC.mx is a Mx script.
I can get two numbers, 126.128 and 29, with this command.

Is there any way to do it like this:

c <- somefunction("mxresult.sh ABC.mx")

Or is their any other way to fulfill the function?

Thanks in advance!

Best washes,
Wei-Wei



More information about the R-help mailing list