Anthony,

See ?make.names for a description of valid names.  Here's an excerpt:

"A syntactically valid name consists of letters, numbers and the dot or 
underline characters and starts with a letter or the dot not followed by a 
number. ... The character "X" is prepended if necessary."

There is an argument in read.csv() called check.names.  Try setting this 
to FALSE and see if that works.

read.csv(file="Something.csv", check.names=F)

Jean

`·.,,  ><(((º>   `·.,,  ><(((º>   `·.,,  ><(((º>

Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
223 East Steinfest Road
Antigo, WI 54409  USA



From:
Anthony Ching Ho Ng <anthony.ch.ng@gmail.com>
To:
r-help@r-project.org
Date:
08/10/2011 08:18 AM
Subject:
[R] column names issue with read.csv
Sent by:
r-help-bounces@r-project.org



Dear List,

I wonder why when using read.csv(), if the column name contains a
numeric i.e. a stock symbols-"0001.HK", it will automatically insert
an "X" character to the column names - "X0001.HK".

Now I have to manually do a loop and use substring() to remove the "X"
character. Any advice? Thanks

Anthony

______________________________________________
R-help@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.



	[[alternative HTML version deleted]]

