To append data to a CSV file in R, you can use the write.table()
function with the append = TRUE
argument. The write.table()
function writes a data frame to a file in tabular format. Here's an example:
main.r384 chars11 lines
This code will create a CSV file called "data.csv" in the working directory (if it doesn't already exist), write the df
data frame to it, and then append the new_data
data frame to it. The final contents of "data.csv" will be:
main.r44 chars6 lines
gistlibby LogSnag