R - 如何删除 write.table(... .txt) 输出的字符串值中的双引号 (" ")?

R - How to remove double quotes (" ") in the string values of write.table(... .txt) output?

假设我有以下数据集,数据:

     Name   Account No. Occupation
     Marie  7672        Nurse
     Jerry  0986        Veterinarian
     Max    3927        Hairdresser

我使用以下代码输出一个名为 "dat" 的数据集:

write.table(dat, file = paste(date, 'output.txt'), na ="", row.names = FALSE, append = TRUE, sep = '\t')

output.txt 长得像

     "Name"     "Account No."    "Occupation"
     "Marie"    7672    "Nurse"
     "Jerry"    0986    "Veterinarian"
     "Max"    3927    "Hairdresser"

如何删除最终输出中的双引号?

write.table(dat, file=paste(date, 'output.txt'), na ="", row.names=FALSE, append=TRUE, sep='\t', quote=FALSE)

您可以使用 quote 参数。