[R] running R in batch with stdin input

Eric Hu list.eric at gmail.com
Fri Jun 16 01:05:11 CEST 2006


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")
...



More information about the R-help mailing list