title: How to compute confusion matrix on Iris dataset?
body: <p>Data set: Iris
  How to compute the confusion matrix on the data set for an LDA (Linear Discriminant Analysis) model?</p>
  
  <pre><code>&gt;iris.lda = lda(Species ~ . , data = iris)
  
  &gt;table(predict(iris.lda, type="class"), iris$Species)
  Error in sort.list(y) : 'x' must be atomic for 'sort.list'
  Have you called 'sort' on a list?
  </code></pre>