title: Using sqldf and RPostgreSQL together
body: <p>When using <code>RPostgreSQL</code> I find that I cannot use <code>sqldf</code> in the same way. For example if I load the library and read in data into a data frame using the following code:</p>
  
  <pre><code>library(RPostgreSQL)
  drv &lt;- dbDriver("PostgreSQL")
  con &lt;- dbConnect(drv, host="localhost", user="postgres", password="xxx", dbname="yyy", port="5436")
  rs &lt;- dbSendQuery(con, "select * from table");                           
  df&lt;- fetch(rs, n = -1); dbClearResult(rs) 
  dbDisconnect(con) 
  </code></pre>
  
  <p>I know have the contents of this table in the dataframe <code>df</code>. However if I want to run a SQL command using <code>sqldf</code> I would previously do something like this:</p>
  
  <pre><code>sqldf("SELECT * FROM df WHERE X &gt; 10")
  </code></pre>
  
  <p>This no longer works as I get the error message:</p>
  
  <pre><code>Error in postgresqlNewConnection(drv, ...) : 
    RS-DBI driver: (could not connect postgres@localhost on dbname "test"
  )
  Error in !dbPreExists : invalid argument type
  </code></pre>
  
  <p>I assume this is operator error on my part, but I can't figure how what arguments to supply to <code>sqldf</code> so that it just focuses on the data frame and does not try to connect to anything else.</p>