[R] running R in batch with stdin input

2006-06-15 Thread Eric Hu
Hi I have a R script that needs to run a few times for different
systems. I use R --no-save  r.script for one system. I am trying with
no luck to use R CMD BATCH to introduce an stdin input variable for
the script. I wonder if anyone can provide the correct usage to put
the variable in the command like R CMD BATCH r.script name_variable.

Thanks.

-Eric

In the r.script I have

name - readline(/dev/stdin)
r0 - read.table(/usr/local/surface/$name/$name_c_r)
...

I want to get at the end:

name - 1BRS
r0 - read.table(/usr/local/surface/1BRS/1BRS_c_r)
...

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


Re: [R] running R in batch with stdin input

2006-06-15 Thread Adaikalavan Ramasamy
?commandArgs



On Thu, 2006-06-15 at 16:05 -0700, Eric Hu wrote:
 Hi I have a R script that needs to run a few times for different
 systems. I use R --no-save  r.script for one system. I am trying with
 no luck to use R CMD BATCH to introduce an stdin input variable for
 the script. I wonder if anyone can provide the correct usage to put
 the variable in the command like R CMD BATCH r.script name_variable.
 
 Thanks.
 
 -Eric
 
 In the r.script I have
 
 name - readline(/dev/stdin)
 r0 - read.table(/usr/local/surface/$name/$name_c_r)
 ...
 
 I want to get at the end:
 
 name - 1BRS
 r0 - read.table(/usr/local/surface/1BRS/1BRS_c_r)
 ...
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


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