To write to a file in R, you can use the write()
function to write text to a file, or the write.csv()
function to write a data frame to a csv file.
Here's an example of writing to a text file:
246 chars12 lines
And here's an example of writing a data frame to a CSV file:
202 chars9 lines
In both cases, the resulting file will be written to the current working directory unless a full file path is provided.
gistlibby LogSnag