[R] execute R expression from command line

Seth Falcon sfalcon at fhcrc.org
Thu Sep 8 20:34:02 CEST 2005


On  8 Sep 2005, uofiowa at gmail.com wrote:

> Can I execute an R expression from the command line without having
> it in an infile, something like perl's -e flag. So it would look
> like:
>
> R {Rexpression;} > outfile

With a bash-like shell, you can do:

echo "library(foo); somefunc(5)" | R --slave 

HTH,

+ seth




More information about the R-help mailing list