[Rd] suggestion for read.table

Benjamin Tyner btyner at gmail.com
Thu Sep 20 23:04:53 CEST 2007


R-devel,

IMHO, in readtable.R, the scan command


if (nlines > 1)
            for (i in seq_along(col))
                col[i] <- length(scan(file, what = "", sep = sep,
                                      quote = quote,
                                      nlines = 1, quiet = TRUE, skip = 0,
                                      strip.white = strip.white,
                                      blank.lines.skip = blank.lines.skip,
                                      comment.char = comment.char,
                                      allowEscapes = allowEscapes))
        cols <- max(col1, col)


should have fill = fill added. Otherwise, when fill = TRUE, it is
possible for the warning

warning("header and 'col.names' are of different lengths")

to be inadvertantly triggered further down.

Ben



More information about the R-devel mailing list