[R] Command line and R

Roger Bivand Roger.Bivand at nhh.no
Wed Nov 9 12:39:11 CET 2005


On Wed, 9 Nov 2005, Angelo Secchi wrote:

> 
> 
> Hi,
> I wrote a small R script (delta.R) using commandArgs(). The script
> works from the shell in usual way
> 
> R --no-save arg1 < delta2.R
> 
> Suppose arg1 is the output of another shell command (e.g. gawk,
> sed ...). Is there a way to tell R to read arg1 from the
> output of the previous command? Any other workaround?

Use shell variables, possibly also Sys.getenv() within R as well as or 
instead of commandArgs().

> Thanks
> 
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list