reading a csv file with repeated row names in R

前端 未结 7 1367
天命终不由人
天命终不由人 2020-12-09 15:55

I am trying to read a csv file with repeated row names but could not. The error message I am getting is Error in read.table(file = file, header = header, sep = sep, qu

相关标签:
7条回答
  • 2020-12-09 16:47

    the function is seeing duplicate row names, so you need to deal with that. Probably the easiest way is with row.names=NULL, which will force row numbering--in other words, it treats your first column as the first dimension and not as the row numbers, and so adds row numbers (consecutive integers starting with "1".

    read.csv("S1N657.csv", header=T,fill=T, col.names=c("dam","anim","temp"), row.names=NULL)
    
    0 讨论(0)
提交回复
热议问题