rcsv

R: Read csv with row and column name


I have a csv with column name in first row of the file, and column name in first column of the file, like this:

ColName1 ColName2 ... ColNameN
RowName1 ..
RowName2 ..
RowNameN .. 

If I use this command: read.csv("/Users/MNeptune/Documents/workspace R/simulatedProfiles.csv", header=TRUE)

I read correctly only columns name but not row name. What i can do to read row name?


Solution

  • Try read.csv("filename.csv", row.names = 1, header= TRUE).