[R] how to skip out and go on read while the read.table meet with a null file

Jie Tang totangjie at gmail.com
Tue Jun 12 04:06:32 CEST 2012


hi ,R users
 I read a series of file by the command shown as below.
cop_x_data<-read.table(flnm,skip=2)
the first two line of the files are headfile and I skip them.
and sometimes the original data file is null and there is no any data
in the file except for the  head information.
At this situation,my command would be in the error and tell me that
there is not data in the file and can not go on.
How can I go on read the files even if the file is null?
thank you
-- 
TANG Jie



More information about the R-help mailing list