title: 'list' object cannot be coerced to type 'double'- as.numeric() in R
body: <p>Like in the <code>iris</code> dataset, in my data all columns are classified as numeric, but the whole data.frame is not classified as numeric. The following code shows what I tried.
  I want <code>iris</code> to be numeric without changes in the form of the data</p>
  <pre><code>data(&quot;iris&quot;)
  &gt; is.numeric(iris)
  [1] FALSE
  iris &lt;- as.numeric(iris)
  ERROR: 'list' object cannot be coerced to type 'double'
  
  &gt; iris &lt;- lapply(iris, as.numeric)
  &gt; is.numeric(iris)
  [1] FALSE
  
  &gt; iris &lt;- as.numeric(unlist(iris))
  &gt; is.numeric(iris)
  [1] TRUE ##but now it is only one column (instead of 5)
  </code></pre>