You should be able to specify this with the row.names
parameter in read.csv
. Although I can't say exactly what to type since I don't have the original dataset, it should be something like:
read.csv(file = "myfile.csv", row.names = 1, [other options])
indicating that row names can be found in the first column.
If you're using some other method of importing the file (e.g. by using the RStudio graphical interface), there should be an option somewhere along the way to specify the location of row names.
Alternatively, a possibly easier approach is suggested by the read.csv
documentation:
If row.names is not specified and the header line has one less entry than the number of columns, the first column is taken to be the row names. This allows data frames to be read in from the format in which they are printed. If row.names is specified and does not refer to the first column, that column is discarded from such files.
Try deleting the X in the top left corner of your .csv file (and delete the comma that follows it) and see if that gets you anywhere.
EDIT Marius has the right suggestion, by the way - just ignore the junk column and work with row numbers instead. (What's the harm?)