I have a continous process that collects data, and I want to write the data that were collected every hour. Simply, how can I conditionally save data every hour to an .Rdata file.
For context, I collect data in a list, wish to save the list object to an hourly file, remove the list, and rebuild it.
I tried the code below but it did not work:
if (identical(format(Sys.time(), "%M:%S"), "00:00")) {
save(twt, file=fname_r)
}
Any help will be much appreciated.