title: Is there an efficient way to append to an existing csv file without duplicates in R?
body: <p>There is a data.frame appended to a existing file. When it is appended by write.table function, it might cause duplicated records into the file. Here is the sample code:</p>
  
  <pre><code>df1&lt;-data.frame(name=c('a','b','c'), a=c(1,2,2))
  write.csv(df1, "export.csv", row.names=FALSE, na="NA"); 
  
  #"export.csv" keeps two copies of df1
  write.table(df1,"export.csv", row.names=F,na="NA",append=T, quote= FALSE, sep=",", col.names=F);
  </code></pre>
  
  <p>So ideally the output file should only keep one copy of df1. But the write.table function doesn't have any parameter for duplicate check.</p>
  
  <p>Thank you for any suggestion in advance.</p>