[R] R script

Aboubakar Maitournam amaitour at pasteur.fr
Fri Oct 19 10:07:13 CEST 2001


Clark Christensen wrote:

> Is there some way run an R script from the command line?  Can I put a
> line at the top of the file like I would for a bash or perl script?  For
> example, a such a script (test.r) might look like.
>
> #!/usr/bin/R
>
> x <- c(1:10)
> print(x)
>
> running ./test.r at the command line doesn't work.  So is there a way to
> do this?  Am I missing something, or do I just have to start R and
> source() the script file (sans #!/usr/bin/R) like I'm already doing?
>
> Clark
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

I have had the same problem by trying to install R.1.3.1. I m not specialist so my

answer will be perhaps not clear or stupid. I think that you must copy the R
script
in the directory as /usr/local/bin/R and it must be "world readable" (chmod u, g
and o +r)
and executable(+x). If it's impossible for you to copy the script you have not
probably
the authorization (so see you "root").
The other solution is to type  all directory path which contains /.R  (I think
that is /usr/bin/.R for you)
the thing before ./R must be all the path where is the script (/usr/bin).

Bye good luck.

Aboubakar Maitournam.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list