?try()
On Fri, Jan 1, 2010 at 3:41 PM, Peng Yu <pengyu...@gmail.com> wrote: > read.table terminates the program if the input file is empty. Is there > way to let the program continue and return me a NULL instead of > terminating the program? > > $ Rscript read_empty.R > > read.table("empty_data.txt") > Error in read.table("empty_data.txt") : no lines available in input > Execution halted > $ cat read_empty.R > read.table("empty_data.txt") > $ cat empty_data.txt; echo EOF > EOF > > ______________________________________________ > 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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ 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.