title: Error: attempt to apply non-function when using caret package
body: <p>I'm trying to understand a bit more about the <code>caret</code> package and ran into a roadblock that I'm unsure how to resolve.</p>
  
  <pre><code>#loading up libraries
  library(MASS)
  library(caret)
  library(randomForest)
  data(survey)
  data&lt;-survey
  
  #create training and test set
  split &lt;- createDataPartition(data$W.Hnd, p=.8)[[1]]
  train&lt;-data[split,]
  test&lt;-data[-split,]
  
  
  #creating training parameters
  control &lt;- trainControl(method = "cv",
                          number = 10, 
                          p =.8, 
                          savePredictions = TRUE, 
                          classProbs = TRUE, 
                          summaryFunction = "twoClassSummary")
  
  #fitting and tuning model
  tuningGrid &lt;- data.frame(.mtry = floor(seq(1 , ncol(train) , length = 6)))
  rf_tune &lt;- train(W.Hnd ~ . , 
              data=train, 
              method = "rf" ,
              metric = "ROC",
              trControl = control)
  </code></pre>
  
  <p>keep getting an error: </p>
  
  <pre><code>Error in evalSummaryFunction(y, wts = weights, ctrl = trControl, lev = classLevels,  : 
    attempt to apply non-function
  </code></pre>
  
  <p>I have confirmed that my DV (W.Hnd) is a factor level so a random forest would be appropriate to use for classification. My assumption is that <code>caret</code> doesn't know to apply to the <code>randomForest</code> algorithm? Other than that I have no idea. </p>