title: Error 'no method for coercing this S4 class to a vector' when connecting to a MySQL database in R
body: <p>I am trying to connect to a MySQL database from R in R console.</p>
  <pre><code>library(RODBC)
  library(RMySQL)
  connect &lt;- odbcConnect(MySQL(),
                         host = 'localhost', 
                         user = 'root',
                         pwd = 'password',
                         dbname = 'database')
  </code></pre>
  <p>I get this error:</p>
  <blockquote>
  <p>Error in as.character.default(&lt;S4 object of class &quot;MySQLDriver&quot;&gt;) :
  no method for coercing this S4 class to a vector</p>
  </blockquote>
  <p>I have no problems accessing this database using Python and directly in MySQL Workbench (on the same laptop). My system has R version 3.4.3, MySQL version 14.14 Distribution 5.7.17, for OS X 10.11.6.</p>
  <p>Searching Stack Overflow for the error revealed a couple of posts <a href="https://stackoverflow.com/questions/37397850/eerror-in-r-no-method-for-coercing-this-s4-class-to-a-vector">here</a> and <a href="https://stackoverflow.com/questions/38102956/no-method-for-coercing-this-s4-class-to-a-vector-for-utilization-of-mclust">here</a> that aren't related to my problem as far as I can tell.</p>
  <p>Is there a simpler test or a diagnostic I could perform to make progress with my R error?</p>