[R] how to avoid add 'X' before numeric colnames when read.table

Greg Snow Greg.Snow at imail.org
Thu May 28 21:40:56 CEST 2009


This really depends on where the 'X' is coming from, which you did not tell us (see the posting guide).

For example, if the 'data.frame' function is the one adding the 'X', then you can use the 'check.names' argument to prevent the addition (or you can use data.frame with the argument to explicitly create your own data frame with the names you want, then pass that to the function that is doing the conversion currently).

If a different function is adding the 'X', then look at the help page for that function, or give us more to go on.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Zheng, Xin (NIH) [C]
> Sent: Thursday, May 28, 2009 1:26 PM
> To: r-help at r-project.org
> Subject: [R] how to avoid add 'X' before numeric colnames when
> read.table
> 
> Hi all,
> 
> Is there any way to keep numeric colnames as is? Any hint will be
> appreicated.
> 
> Xin Zheng
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list