0

I first made a matrix which looks like

        1    2     3     4      5
11050  123  121   110   182    199
dist   0.1  0.2   0.5   0.61   0.78
11051  121  122   155   198    192
dist   0.1  0.3   0.44  0.55   0.88
11052  128  199   125   122    134
dist   0.12 0.2   0.4   0.5    0.56

using rbind method, accumulating 6 vectors by row. where the row names of this matrix are [11050, dist, ..., 11052, dist]

I extracted this matrix into a csv file with write.table function, and I now tried read that file into R space back which didn't work. An error occurred that row names can't have duplicate values, which made me go crazy... how can I exactly reshape the matrix by reading the csv file?

I read what someone linked as the duplicate question of mine, but row.names=NULL doesn't seem to solve the matter. A new column indicating row names 1 to 6 automatically appears, but I still can read my csv file without row.names=NULL.

I tried some more ways and figured out that matrix is possible to have duplicate of row names. So I'd rather change the data into a matrix first and then change its row names.

Mons2us
  • 192
  • 1
  • 1
  • 9
  • Oh and if one can answer this in addition, I'd really appreciate it - I thought when using rbind function, the result always comes out as a data frame shape, but the one I made above didn't but as a matrix. Is it because they have duplicate row names? – Mons2us Mar 16 '17 at 16:27
  • For your comment, read the Value section of `?rbind`. – lmo Mar 16 '17 at 16:34
  • @Imo Thanks. I was totally misunderstanding. It shapes into a matrix not a data frame. – Mons2us Mar 16 '17 at 17:06

0 Answers0