[R] row.name in data.frame

S Peri biocperi at yahoo.com
Tue Oct 5 22:03:04 CEST 2004


Hi Group, 
 
 I have a table with column names and row names. 

Species  A  B  C  D  E   F  G 
Human    1  2  3  4  1   0  3
Rat      0  2  3  3  2   1  2


I read this tab delim. text file into R like the
following:
> mydata <-read.table('mydata.txt',header=TRUE)
> mydata
  Species A B C D
1   Human 1 2 3 2
2     Rat 0 2 5 2
3     Cat 9 2 4 1


Why am I getting 1,2,3 row names even after declaring
heder = TRUE.  I tried declaring row.names = NULL,
however it is not accepting it and expects a vector
with some names. I wanted Human, Rat and Cat as my row
names. I wanted my data frame look like:

Species A B C D
Human 1 2 3 2
Rat 0 2 5 2
Cat 9 2 4 1

I apologise for asking a lame question and this
question might have been posted several times. I could
not find an answer. 

Thanks
P




More information about the R-help mailing list