[R] read.table problem with column headers
thomas_l_arnold at yahoo.com
Wed Mar 27 17:05:55 CET 2002
When I use read.table I can't get my column names to
line up with my data.
The data file has survey response data, and each line
starts with a unique key field (which should be the
row name when it gets read in, right? I've only been
using R for one day so bear with me)
The first row in the file has column names, and the
first name is "Key", followed by "Age" and so on. for
Key;Age;Gender;Years In IT; #more column labels...
20020220_144752_15178;41;0;17; #more data...
When I read this in, saying
survey = read.table("myfile.dat",TRUE,";")
I wind up with "Age" column being named "Key" and all
the column labels shift to the right. No matter what
I've tried, I can't put *my* header on the first
column of row names. If it put no header on that
column, I get an error "more columns than column
What can I do to get my data labels on correctly?
Summit Media Partners
Visit our web site at http://www.summitmediapartners.com
Yahoo! Movies - coverage of the 74th Academy Awards®
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help