问题描述
我试图将一个数据框写入一个没有标题的 txt 文件,但它一直在添加列名。当我直接从驱动器打开文件时,它有 21 行没有标题,但是当我使用 read.delim() 打开文件时,我可以看到带有一些符号的标题。
这是代码
write.table(trans_sequence,file="mytxtout.txt",sep=";",col.names =FALSE,row.names = FALSE,quote = FALSE)
当我使用 read.delim 检索数据时,如下所示。它应该有 21 行,但它使顶行成为列名,即 20 行。第一行应该是这样的 2745;9;2;HbA1c;LDL;C;测试 但它创建了一个标题
read.delim("mytxtout.txt")
X2745.9.2.HbA1c.LDL.C.Tests
1 10433;9;2;BMI;Blood Pressure
2 13601;0;1;LDL-C Tests
3 13601;6;1;LDL-C Tests
4 36127;2;2;BMI;Blood Pressure
5 36127;5;1;Blood Pressure
6 36127;9;2;BMI;Blood Pressure
7 36127;10;2;BMI;Blood Pressure
8 54881;9;2;HbA1c;LDL-C Tests
9 59650;0;2;BMI;Blood Pressure
10 59650;3;2;BMI;Blood Pressure
11 66741;0;1;LDL-C Tests
12 72772;3;1;LDL-C Tests
13 77618;2;3;BMI;BMI percentile;Blood Pressure
14 77618;3;2;BMI;BMI percentile
15 81397;4;1;BMI
16 81397;6;2;BMI;Blood Pressure
17 81397;9;2;BMI;Blood Pressure
18 81397;9;1;BMI
19 83520;6;3;BMI;BMI percentile;Blood Pressure
20 85178;10;1;LDL-C Tests
任何帮助将不胜感激
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)