[R] problem in reading file
chakri
chakri2sai at yahoo.co.in
Mon Nov 28 13:02:32 CET 2011
Hi,
I have a file that looks like this :
one,0
two,0.591,0
three,0.356,0.350,0
four,-0.098,0.072,0.380,0
five,0.573,0.408,0.382,0.062,0
six,0.156,0.232,0.517,0.424,0.303,0
seven,0.400,0.414,0.611,0.320,0.401,0.479,0
eight,0.282,0.375,0.512,0.346,0.308,0.463,0.605,0
nine,0.519,0.484,0.467,0.167,0.455,0.311,0.574,0.557,0
I want to create a data matrix out of it, so I tried this :
x<-read.table('test.csv',fill=TRUE, sep=",",dec=".",row.names=1)
row.names(x) # print row names
output
[1] "one" "two" "three" "four" "five" "six" "0" "seven" "0.479"
[10] "eight" "0.463" "nine" "0.311"
Even numerics are taken in as row names. What am I missing here ?
Thanks in Advance
Chakri
--
View this message in context: http://r.789695.n4.nabble.com/problem-in-reading-file-tp4114955p4114955.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list