hi Gang and Andrew
Did this ever get sorted? I have come across this same problem. From what I can tell, when readline() is used in non-interactive mode it simply returns an empty string, which is causing the above error. I found that by replacing the calls to readline() with calls to scan()
I can get the AFNI R programs to work with R CMD BATCH--using scan(n=1) for lines containing integers and scan(what="character", n= 1) for lines containing strings (for instance, the name of the covariate file). Is there an easier workaround for this?
thanks
James