Hello,
I have this script which will be invoked as

Rscript a.r < a.r

a.r follows

#!/usr/bin/Rscript --vanilla
f=file("stdin")
while(TRUE){
    y=readLines(f,n=1,warn=TRUE)
  if(length(y)==0) break else print(y)
}


But it only reads one line from a.r
How can I read line by line from standard input?

Thank you
Saptarshi

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to