priyanka singh
priyanka singh

Reputation: 11

writing a file using write.table from R

I imported a text file into R and performed some operations. When i try to write the file using write.table, the generated text file has inverted commas at the beginning and the end of each lines. I do not need these. Any way to remove this using R?

"001723514161chfbed5e77A 59310057920012012-08-30011578579959" "003537255515ch3a6381b7A 59310057920012011-06-05011578579959"

Code:

write.table(my_data_updated, "mydata2.txt",row.names = F,col.names = F)

Upvotes: 1

Views: 225

Answers (1)

dpel
dpel

Reputation: 2121

Use quote=F for example:

Data

my_data_updated <- c("001723514161chfbed5e77A 59310057920012012-08-30011578579959", "003537255515ch3a6381b7A 59310057920012011-06-05011578579959")

Write table

write.table(my_data_updated, "mydata2.txt",row.names = F,col.names = F, quote=F)

Upvotes: 1

Related Questions