Add lines to a file

Sergio Vela picture Sergio Vela · Oct 12, 2011 · Viewed 78.5k times · Source

I'm new using R. I'm trying to add new lines to a file with my existing data in R. The problem is that my data is of about 30000 rows and 13000 cols. I already try to add a line with the writeLines function but the resulted file contains only the line added.

Answer

user554546 picture user554546 · Oct 12, 2011

Have you tried using the write function?

line="blah text blah blah etc etc"
write(line,file="myfile.txt",append=TRUE)