From btyner at gmail.com  Thu Sep 20 23:07:18 2007
From: btyner at gmail.com (Benjamin Tyner)
Date: Thu, 20 Sep 2007 17:07:18 -0400
Subject: [Rd] suggestion for read.table
In-Reply-To: <5f88b2c50709201404w5c50dc33pfc49f6a55ad69a48@mail.gmail.com>
References: <5f88b2c50709201404w5c50dc33pfc49f6a55ad69a48@mail.gmail.com>
Message-ID: <5f88b2c50709201407u64a90e2ay6defcfabb1af5397@mail.gmail.com>

Correction: the warning would be triggered by

warning("cols = ", cols, " != length(data) = ", length(data), domain = NA)

Ben

On 9/20/07, Benjamin Tyner <btyner at gmail.com> wrote:
> 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
>



[Rd] suggestion for read.table
Benjamin Tyner