Marta Karas
Marta Karas

Reputation: 5155

R how to save data to CSV without " string separator written

How to write a data frame of character values to CSV file with ; as separator between columns and NO " sign (and no any other sign) marking the beginning and the end of a char passage?

write.table(my.df, file = "my_data.csv", row.names=FALSE, na="", col.names=FALSE, sep=";")

results in:

"abc";"abc2";"abc3"
(...)

whereas I would like to have:

abc;abc2;abc3
(...)

Upvotes: 0

Views: 1297

Answers (1)

Thomas
Thomas

Reputation: 44525

Use quote = FALSE:

> write.table(letters[1:3], quote = FALSE, sep = ';')
x
1;a
2;b
3;c

Upvotes: 5

Related Questions