title: Plot ROC curve with pROC R
body: <p>I build a text classifier with randomForest, so to evaluate it I try to create a ROC curve with pROC pâckage .</p>
  
  <p>Here the code :</p>
  
  <pre><code>ndsi.forest &lt;- randomForest(tf.idf[train.index, ], as.factor(train$Note.Reco[train.index]), ntree = 100)
  
  #predict with test data
  ndsi.pred &lt;-predict(ndsi.forest, newdata = tf.idf[test.index, ], response  = 'class')
  pred &lt;- data.frame(ndsi.pred)
  result &lt;- data.frame(id = Data_clean$id[test.index], sentiment = pred[ , ])
  
  ##"ROC curve"
  multiclass.roc(result$sentiment, test$Note.Reco)
  </code></pre>
  
  <p>I was wondering if is teher a way to create the plot? ROC plot with pROC package?</p>
  
  <p>I try with this code : </p>
  
  <pre><code>roc(test$Note.Reco, result$sentiment, levels = c(1,2,3,4,5,6,7,8,9,10))
  </code></pre>
  
  <p>But I get this error : </p>
  
  <pre><code>Error in roc.default(test$Note.Reco, result$sentiment, levels = c(1, 2,  : 
    'levels' argument must have length 2
  </code></pre>
  
  <p>thank you in advance</p>