[R] running R in batch with stdin input

From: Eric Hu <list.eric_at_gmail.com>
Date: Fri 16 Jun 2006 - 09:05:11 EST


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 Received on Fri Jun 16 09:09:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 16 Jun 2006 - 12:12:33 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.