将数据帧写入文件.txt

时间:2020-03-31 01:50:52

标签: r dataframe

当我使用以下命令写入数据框时:

write.table(dfArticles,"C:/Biology.txt",append = FALSE,sep=",",dec=".")

我得到以下结果:

"Title","Authors","AuthorAffiliations","CorrespondenceAuthor","PublishDate","Abstract","Keywords"
"1","Characterisation of genetic regulatory effects for osteoporosis risk variants in human osteoclasts","Benjamin H. Mullin,Jennifer Tickner,Kun Zhu,Jacob Kenny,S ..................

文件“ Biology.txt”在每一行的开头都包含值“ 1”“ 2”“ 3”...。

为什么包括数字?

1 个答案:

答案 0 :(得分:1)

我们可以使用row.names = FALSE参数。

write.table(dfArticles,"C:/Biology.txt",append = FALSE,sep=",",dec=".",row.names=FALSE)