title: Train function from R caret package error: "Something is wrong; all the Accuracy metric values are missing"
body: <p>I want to run a <code>logreg</code> regression. I obtain the following error after running my code on R:</p>
  
  <p>Something is wrong; all the Accuracy metric values are missing:</p>
  
  <pre><code>    Accuracy       Kappa    
   Min.   : NA   Min.   : NA  
   1st Qu.: NA   1st Qu.: NA  
   Median : NA   Median : NA  
   Mean   :NaN   Mean   :NaN  
   3rd Qu.: NA   3rd Qu.: NA  
   Max.   : NA   Max.   : NA  
   NA's   :9     NA's   :9    
  Error in train.default(x, y, weights = w, ...) : Stopping
  In addition: There were 19 warnings (use warnings() to see them)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>## Data
  donner &lt;- read.delim("http://web.as.uky.edu/statistics/users/pbreheny/760/data/donner.txt")
  set.seed(1234)
  library(caret)
  donner$Age &lt;- as.numeric(donner$Age)
  donner$Status &lt;- as.factor(donner$Status)  
  donner$Sex &lt;- as.numeric(donner$Sex) 
  splitIndex &lt;- createDataPartition(donner$Status, p = .80, list = FALSE, times = 1)
  trainDF &lt;- donner[splitIndex,]
  testDF &lt;- donner[-splitIndex,]
  ctrl &lt;- trainControl(method = "cv", number = 2)
  logregmodel &lt;- train(Status ~ ., data = donner, method = "logreg", trControl = ctrl)
  </code></pre>
  
  <p>EDIT 1:</p>
  
  <p>I changed the status to binary (0 and 1) and I still have some errors. Here is the new code:</p>
  
  <pre><code>## Data
  donner &lt;- read.delim("http://web.as.uky.edu/statistics/users/pbreheny/760/data/donner.txt")
  set.seed(1234)
  library(caret)
  donner$Age &lt;- as.numeric(donner$Age)
  donner$Status &lt;- as.integer(donner$Status)-1  
  donner$Sex &lt;- as.numeric(donner$Sex)-1 
  splitIndex &lt;- createDataPartition(donner$Status, p = .80, list = FALSE, times = 1)
  trainDF &lt;- donner[splitIndex,]
  testDF &lt;- donner[-splitIndex,]
  ctrl &lt;- trainControl(method = "cv", number = 2)
  donner$Status &lt;- as.factor(donner$Status)
  logregmodel &lt;- train(Status ~ ., data = donner, method = "logreg", trControl = ctrl)
  </code></pre>