Skip to content
Prev 205105 / 398506 Next

How to not to terminate read.table if the input file is empty?

Please give reproducible example, more information on your
troubleshooting and sessionInfo().  Cannot reproduce:
size isdir mode               mtime               ctime
empty.txt    0 FALSE  666 2010-01-01 12:50:55 2010-01-01 12:45:34
                        atime exe
empty.txt 2010-01-01 12:45:34  no
Error in read.table(pathname) : no lines available in input
R version 2.10.1 Patched (2009-12-24 r50837)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

/Henrik
On Fri, Jan 1, 2010 at 12:41 PM, Peng Yu <pengyu.ut at gmail.com> wrote: