[R] scan not working

Emily Sessa sessa.emily at gmail.com
Sun Jan 27 08:33:24 CET 2013


Hi all, 

I am trying to use the scan function in an R script that I am calling from the command line on a Mac; at the shell prompt I type: 

$ Rscript get_q_values.R LRT_codeml_output 

in the hope that LRT_codeml_output will get passed to the get_q_values R script. The first line of that script is: 

chidata <- scan(file="")

which, as I understand how scan works, will read the contents of the file from the command line into the object chidata. I did this a few times and it worked like a charm. And then, it stopped working. Now, every time I try to do this, I get "Read 0 items" as the next line in the terminal window, and the output produced by the script is empty, because it's apparently no longer reading anything in. I don't think I changed anything in the script; it just stopped being able to execute the scan function. Does anyone have any idea how to fix this?? I did not have anything else in that scan line when it was working before. I've updated R and restarted my computer in the hope that it would help, but it hasn't. Any help would be much appreciated.

-ES


More information about the R-help mailing list