[R] read.table: check.names arg - feature request

Martin Maechler maechler at stat.math.ethz.ch
Thu Sep 4 10:28:02 CEST 2003


>>>>> "Vadim" == Vadim Ogranovich <vograno at evafunds.com>
>>>>>     on Wed, 3 Sep 2003 14:29:25 -0700 writes:

    Vadim> Hi, I thought it would be convenient if the
    Vadim> check.names argument to read.table, which currently
    Vadim> can only be TRUE/FALSE, could take a function value
    Vadim> as well. If the function is supplied it should be
    Vadim> used instead of the default make.names.

One could, but it's not necessary in your case (see below), and
it's a potential pit to fall in..  We want read.table() to
return valid  data frames.

    Vadim> Here is an example where it can come in handy. I tend
    Vadim> to keep my data in coma-separated files with a header
    Vadim> line. The header line is prefixed with a comment sign
    Vadim> '#' to simplify identification of these lines. Now
    Vadim> when I read.table the files the '#' is converted to
    Vadim> '.' while I want it to be discarded.

Hmm, are you using a very old version of R,
or haven't you seen the `comment.char = "#"' argument of
read.table()?

Reading "?read.table", also note the note about
`blank.lines.skip' , and then realize that the default for
blank.lines.skip is  ` !fill ' and that `fill = TRUE' for all
the read.csv* and read.delim* incantation of read.table().

In sum, it's very easy to use current read.table() for your
situation!

    Vadim> P.S. I don't know if r-help is the right place for
    Vadim> feature requests. If it's not please let me know
    Vadim> where the right one is.

Since your proposal can be interpreted as "How do I use
read.table() when my file has comment lines?",
r-help has been very appropriate.

Otherwise, and particularly if the proposal is more technical,
R-devel would be better suited.

Regards,
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list