When a file containing a table or dataframe with character values has been created in R using write.table()
or write.csv()
, but is opened on a text editor, the values are all in double quotes in the text editor, for example
"MM","M786"
"MM","M797"
"MM","M801"
Is there a way to save the table or dataframe in R so that the double quotes do not show when opening the file with a text editor? So it shoud be
MM,M786
MM,M797
MM,M801
Thanks!
Use quote = FALSE
-
write.csv(df, 'out.csv', row.names = FALSE, quote = FALSE)
write.table(df, 'out.txt', quote = FALSE, row.names = FALSE)