[R] How can I use R through command line?

Martin Maechler maechler at stat.math.ethz.ch
Wed Apr 1 10:33:59 CEST 2009


>>>>> "r" == ronggui  <ronggui.huang at gmail.com>
>>>>>     on Wed, 1 Apr 2009 16:00:16 +0800 writes:

    r> you can use source() to Read R Code from a File.

yes, but that's not "in the command line". 
Slightly more closely to the OP's question:

      R CMD BATCH test.R
or
      Rscript test.R

(or   " r  test.R "   if you have installed  'littler' )

Martin Maechler, ETH Zurich 

    r> 2009/4/1 minben <minbenh at gmail.com>:

    >>  Suppose I have written a R program and saved it in test.R . How can I
    >> call the program in the command line?




More information about the R-help mailing list