title: Append new data to an existing dataframe (RDS) in R
body: <p>I have an Rscript that is reading in a constant stream of data in the form of a flat file.  Another script picks up this flat file, does some parsing and processing, then saves the result as a data.frame in RDS format.  It then sleeps, and repeats the process.  </p>
  
  <pre><code>saveRDS(tmp.df, file="H:/Documents/tweet.df.rds") #saving the data.frame
  </code></pre>
  
  <p>On the second... nth iteration, I have the code only process the new lines added to the flat file since the previous iteration.  However, in order to append the delta lines to the permanent data frame, I have to read it in, append, and then save it back out, overwriting the original.</p>
  
  <pre><code>df2 &lt;- readRDS("H:/Documents/tweet.df.rds") #read in permanent                      
  tmp.df2 &lt;- rbind(df2, tmp.df) #append new to existing
  saveRDS(tmp.df2, file="H:/Documents/tweet.df.rds") #save it
  rm(df2) #housecleaning
  rm(tmp.df2) #housecleaning
  </code></pre>
  
  <p>This approach is risky because whenever the RDS is open for reading/writing, another process wanting to touch that file has to wait. As the base file gets bigger, the risk increases. </p>
  
  <p>Is there something like an <code>appendRDS</code> (I know literally there isn't) that can achieve what I want- iterative updating of a single data frame- saved to a file- that uses appending rather than complete replacement?</p>