title: missing value where TRUE/FALSE needed with Caret
body: <p>I have a data frame, which contains the "date variable".
  (the test data and code is available <a href="https://www.dropbox.com/sh/u62abna1cp4fw8n/AAC9EXdhNN8GKdVqkgOM6OQ-a?dl=0" rel="nofollow">here</a>)</p>
  
  <p>However, I use "function = caretFunc". It shows error message.</p>
  
  <pre><code>    Error in { : task 1 failed - "missing value where TRUE/FALSE needed"
  In addition: Warning messages:
  1: In FUN(newX[, i], ...) : NAs introduced by coercion
  2: In FUN(newX[, i], ...) : NAs introduced by coercion
  3: In FUN(newX[, i], ...) : NAs introduced by coercion
  4: In FUN(newX[, i], ...) : NAs introduced by coercion
  5: In FUN(newX[, i], ...) : NAs introduced by coercion
  6: In FUN(newX[, i], ...) : NAs introduced by coercion
  7: In FUN(newX[, i], ...) : NAs introduced by coercion
  8: In FUN(newX[, i], ...) : NAs introduced by coercion
  9: In FUN(newX[, i], ...) : NAs introduced by coercion
  10: In FUN(newX[, i], ...) : NAs introduced by coercion
  </code></pre>
  
  <p>What can I do?</p>
  
  <hr>
  
  <p>Code to reproduce the error:</p>
  
  <pre><code>library(mlbench)
  library(caret)
  library(maps)
  library(rgdal)
  library(raster)
  library(sp)
  library(spdep)
  library(GWmodel)
  library(e1071)
  library(plyr)
  library(kernlab)
  library(zoo)
  
  mydata &lt;- read.csv("Realestatedata_all_delete_date.csv", header=TRUE)
  mydata$estate_TransDate &lt;- as.Date(paste(mydata$estate_TransDate,1,sep="-"),format="%Y-%m-%d")
  mydata$estate_HouseDate &lt;- as.Date(mydata$estate_HouseDate,format="%Y-%m-%d")
  
  rfectrl &lt;- rfeControl(functions=caretFuncs, method="cv",number=10,verbose=TRUE,returnResamp = "final")
  results &lt;- rfe(mydata[,1:48],mydata[,49],sizes = c(1:48),rfeControl=rfectrl,method = "svmRadial")
  
  print(results)
  predictors(results)
  plot(results, type=c("g", "o"))
  </code></pre>