简体   繁体   English

从R使用write.table写入文件

[英]writing a file using write.table from R

I imported a text file into R and performed some operations. 我将文本文件导入R并执行了一些操作。 When i try to write the file using write.table, the generated text file has inverted commas at the beginning and the end of each lines. 当我尝试使用write.table写入文件时,生成的文本文件在每行的开头和结尾都有逗号颠倒的现象。 I do not need these. 我不需要这些。 Any way to remove this using R? 任何使用R删除它的方法吗?

"001723514161chfbed5e77A 59310057920012012-08-30011578579959" "003537255515ch3a6381b7A 59310057920012011-06-05011578579959" “ 001723514161chfbed5e77A 59310057920012012-08-30011578579959”“ 003537255515ch3a6381b7A 59310057920012011-06-05011578579959”

Code: 码:

write.table(my_data_updated, "mydata2.txt",row.names = F,col.names = F)

Use quote=F for example: 例如,使用quote=F

Data 数据

my_data_updated <- c("001723514161chfbed5e77A 59310057920012012-08-30011578579959", "003537255515ch3a6381b7A 59310057920012011-06-05011578579959")

Write table 写表

write.table(my_data_updated, "mydata2.txt",row.names = F,col.names = F, quote=F)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM