Re: [R] "#!/usr/bin/R"

About this list Date view Thread view Subject view Author view Attachment view

From: Peter Dalgaard (p.dalgaard@biostat.ku.dk)
Date: Tue 11 May 2004 - 02:52:23 EST


Message-id: <x265b4ql6g.fsf@biostat.ku.dk>


"Liaw, Andy" <andy_liaw@merck.com> writes:

> Someone had modified the R source to handle this, but it has not been
> incorporated into the official R source, if I'm not mistaken. Search the
> R-devel archive.

You can do stuff like this though:

>cat test.R
#!/bin/sh
tail +3 "$0" | R --vanilla --args $@ ; exit $?
x <- 2+2
x
ls()
print(x)
commandArgs()

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:08 EST