write.table extra column

后端 未结 1 988
臣服心动
臣服心动 2021-01-17 12:47

In the following data.frame there are 6 columns, but 7 are written to the CSV file. Can\'t figure out why.

install.packages(\"pmlr\")
library(pmlr)
data(enzy         


        
1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 13:47

    This question is better suited to StackOverflow. In any case, the problem is that R by default writes the row names. To write only the data itself, use

     write.table(enzymes, sep=",", eol="\n", file="albert.csv", row.names=FALSE)
    

    0 讨论(0)
提交回复
热议问题