title: RMySQL fetch - can't find inherited method
body: <p>Using RMySQL I want to load data from a database into a dataframe in R. For this I'm using the following code:</p>
  
  <p>Rconnectdb:</p>
  
  <pre><code>con &lt;- dbConnect(MySQL(),
  user="root", password="password",
  dbname="prediction", host="localhost")
  </code></pre>
  
  <p>Main code</p>
  
  <pre><code>library(RMySQL)
  source("Rconnectdb") #load the database connection
  query = "select received,isRefound from message" #specify query
  rs=dbGetQuery(con,query) #resultset
  dataset &lt;- fetch(rs, n=-1) #fill dataset with all rows of the resultset
  dbClearResult(rs) #clear resultset
  </code></pre>
  
  <p>Executing this I get the following error</p>
  
  <blockquote>
    <p>Error in function (classes, fdef, mtable)  :    unable to find an
    inherited method for function "fetch", for signature "data.frame",
    "numeric"</p>
  </blockquote>
  
  <p>Any ideas?</p>