title: Not able to replace SQLite table with RSQLite/DBI package
body: <p>I'm trying to overwrite a table in a SQLite database with a new table and I get following error message that I do not understand and I wasn't able to find a answer online so far: </p>
  
  <pre><code>RS-DBI driver: (error in statement: duplicate column name: row_names)
  </code></pre>
  
  <p>Below I created some simplified sample code to replicate my problem:</p>
  
  <pre><code>library(RSQLite) # will load DBI as well
  
  ## open a connection to a SQLite database
  con &lt;- dbConnect(dbDriver("SQLite"), dbname = "testDB.db")
  
  # save internal R dataset in database as table
  dbWriteTable(con, "mtcarsTab", mtcars, overwrite = T)
  
  # subset database table and store as data frame
  subDf &lt;- dbGetQuery(con, "SELECT * FROM mtcarsTab WHERE cyl = 4")
  
  # try to replace old table with new table
  dbWriteTable(con, "mtcarsTab", subDf, overwrite = T)
  </code></pre>
  
  <p>Resulting output of the last statement is:</p>
  
  <pre><code>&gt; dbWriteTable(con, "mtcarsTab", subDf, overwrite = T)
  [1] FALSE
  Warning message:
  In value[[3L]](cond) :
    RS-DBI driver: (error in statement: duplicate column name: row_names)
  </code></pre>