我试图从数据框中编写一个csv文件,即:
Col_A Col_B Col_C
Hello World 4
Once More 21
Hi Data 23
到目前为止,我使用此代码:
ds = dataf
write.csv(ds,"test.csv", row.names = FALSE, quote = c(1,2), sep = ",")
然而,结果是:
Col_A,"Col_B","Col_C"
Hello,"World",4
Once,"More",21
Hi,"Data",23
但我真的需要这样的事情:
"Col_A","Col_B","Col_C"
"Hello","World",4
"Once","More",21
"Hi","Data",23
请注意,除非数字值以逗号分隔,否则所有内容都在双引号之间。如果我也写了rownames,我可以这样做,但我真的不想要它们。
答案 0 :(得分:0)
没有必要设置" set"到","因为它是write.csv的默认值。 无论如何,你确定你的data.frame设计? 这似乎有效:
SignInStatus.Success