[R] How to write '"' to a csv with the default setting of write.csv?

Peng Yu pengyu.ut at gmail.com
Fri Jan 22 00:29:40 CET 2010


Please see the following example. I can not write '"' to a csv file
successfully. Could somebody let me if it is possible to write '"' to
a csv file with the default setting of write.csv?

my_home$ Rscript main_quote.R
> x=rbind(
+   "\"A\""
+   , "\"B\""
+   )
> x
     [,1]
[1,] "\"A\""
[2,] "\"B\""
>
> write.csv(x, "main_quote.csv", row.names=F)
>
my_home$ cat main_quote.csv
"V1"
"""A"""
"""B"""



More information about the R-help mailing list