Possible Duplicate:
Write lines of text to a file in R
Is there anyway to write information to a file in R like other languages such as Python or Java?
I mean first open a file to be written and then write the contents of what I do line by line. Actually I do not want to put all my data in a matrix or list first.
Thanks
You want
?connections.For example, from the help for
?file:[1] “TITLE extra line” “2 3 5 7” “” “11 13 17”
[5] “One more line”
Clean up:
See
?cat,?writeLines,?writeBin, and several others in the See Also section of the?connectionshelp page.You can also append with
write.table, either with itsappendargument or by writing to an open connection.