Duplicate 'row.names' error reading table. row.names=NULL shifts columns

前端 未结 5 1955
逝去的感伤
逝去的感伤 2020-12-31 20:11

This is similar to read.csv row.names and to https://stackoverflow.com/questions/12425599/duplicated-row-names , but I do not see answers that help.

Problem: Trying

5条回答
  •  -上瘾入骨i
    2020-12-31 21:12

    I used the following code:

    lm.table  <- read.table("file name", header=TRUE, row.names=NULL)
    

    This added a column to the left with numbered row names, but I didn't find that the column names were shifted. Could it be that your column names still matched the right columns, but the R output made it look like the names had shifted?

提交回复
热议问题