[R] read.table
Weiwei Shi
helprhelp at gmail.com
Thu Oct 19 23:06:04 CEST 2006
thanks. i know how to go around it but i feel read.table should have
something like that to disable the process of adding "X" to the header
:)
On 10/19/06, Marc Schwartz <MSchwartz at mn.rr.com> wrote:
> On Thu, 2006-10-19 at 16:10 -0400, Weiwei Shi wrote:
> > hi,
> >
> > how could I let the colname be the numbers instead of "X" plus numbers
> > when I use read.table. Or there is an alternative way?
> >
> > thanks
>
> Sounds like you have imported the data, perhaps using 'header = TRUE'
> either without an actual header row of column names or perhaps an
> incomplete or improper (not syntactically valid) header row.
>
> If you are getting X's (and not V's) pre-pended to the column names,
> that sounds like the result of make.names() on your data.
>
> See ?make.names
>
> If you don't have a header row in the imported data set, you can use the
> 'colnames' argument in read.table() to explicitly provide them. Just be
> sure to set 'header = FALSE'.
>
> If there is a header row, but it is problematic, set 'header = FALSE'
> AND 'skip = 1', which will skip over the first row in the incoming file.
>
> See ?read.table
>
> HTH,
>
> Marc Schwartz
>
>
>
--
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.
"Did you always know?"
"No, I did not. But I believed..."
---Matrix III
More information about the R-help
mailing list