如何从文件中删除rownames [英] How to remove the rownames from the file

查看:111
本文介绍了如何从文件中删除rownames的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像这样的文件。

I have a file which looks like this..

"Locations" "X9442" "X5997"
"1" "cg00000957"    0.87    0.86
"2" "cg00001349"    0.78    0.78
"3" "cg00001583"    0.06    0.08
"4" "cg00002028"    0.01    0.01

我想删除行名称,如下所示:

I wish to remove the row names and make it look like as follows:

 "Locations"    "X9442" "X5997"
 "cg00000957"   0.87    0.86
 "cg00001349"   0.78    0.78
 "cg00001583"   0.06    0.08
 "cg00002028"   0.01    0.01

我尝试过各种操作,但我无法移除这些索引同时做write.table。有时,标题位置移动其列。有人可以帮助我如何在R或linux中实现上述内容?

I tried various things, but I am not able to remove those indexes while doing write.table. Also sometimes the header "Locations" shifts its column. Can someone help me out how do I achieve the above in R or linux?

推荐答案

查看帮助文件:?write.table 特别是

write.table(dd, file="output.csv", row.names=FALSE)

这篇关于如何从文件中删除rownames的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆