Skip to content
Prev 205107 / 398506 Next

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

On 01-Jan-10 20:41:52, Peng Yu wrote:
If I understand the point of your query correctly, the following,
from "?read.table", would be relevant:

Value:
  A data frame (?data.frame?) containing a representation of the
  data in the file.

  Empty input is an error unless "col.names" is specified, when a
  0-row data frame is returned: similarly giving just a header line
  if "header = TRUE" results in a 0-row data frame.  Note that in
  either case the columns will logical unless ?colClasses? was
  supplied.

The result would not be NULL, but can be tested for zero rows.

Hoping this helps,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 01-Jan-10                                       Time: 20:55:35
------------------------------ XFMail ------------------------------