title: When writing to an excel sheet, how can I add a new row each time I run the script?
body: <p>I've written a script that pulls and summarizes data from 2 databases regularly. I'm using <code>write.xlsx</code> to write 3 data frames to 3 different tabs:</p>
  
  <ul>
  <li>Tab1 is data from one database,</li>
  <li>Tab2 is data from another, and</li>
  <li>Tab3 is data summarized from both.</li>
  </ul>
  
  <p>It is fine if Tabs 1&amp;2 are overwritten with each run, but I'd like Tab3 to add a new row (with <code>sys.date</code> in col1) each run, thus giving me a history of the data summaries. Is this possible and how?</p>
  
  <p><code>append=TRUE</code> is not getting me what I'm looking for. My next option (less desirable) is to just write the summarized data to a separate file with sys.date in the filename.</p>
  
  <pre><code># Write to spreadsheet w/ 3 tabs
  write.xlsx(df1, file = "file_location\\filename.xlsx", sheetName = "dataset1", row.names = FALSE, append = FALSE) #write to tab1
  
  write.xlsx(df2, file = "file_location\\filename.xlsx", sheetName = "dataset2", row.names = FALSE, append = TRUE) #write to tab2
  
  write.xlsx(summary_df, file = "file_location\\filename.xlsx", sheetName = "summarized_data", row.names = FALSE, append = TRUE) #write to next blank row in tab3
  </code></pre>
  
  <p>The script is writing over the summary data with each run. I would like it to append it to the next blank row.</p>