I'm trying to save data in a file, but every time I hit the save button, it saves it but keeps deleting the data I already have there. What could be the problem?
saveData <- function(data) { data <- as.data.frame(t(data)) if (exists("responses")) { responses <<- rbind(responses, data) } else { responses <<- data } write.csv(responses, file = "read.csv", row.names = FALSE)
append = TRUEtowrite.csvand check?write.csv.