title: The tuning parameter grid should have columns mtry
body: <p>I'm trying to use <strong>ranger via Caret</strong>. Interestingly, it pops out an error message:</p>
  
  <pre><code>Error in train.default(x &lt;- as.matrix(train_data[, !c(excludeVar), with = FALSE]),  : 
    The tuning parameter grid should have columns mtry
  </code></pre>
  
  <p>So I check:</p>
  
  <pre><code>&gt; model_grid
    mtry splitrule min.node.size
  1    5      gini            10
  </code></pre>
  
  <p>Codes I used:</p>
  
  <pre><code> mtry &lt;- round(sqrt(ncol(train_data) - 3),0)      # ignore ID fields and target fields
  
   # parameters
   model_grid &lt;- expand.grid(
     mtry = mtry                                    # mtry specified here
     ,splitrule = "gini"
     ,min.node.size = 10
   )
   model_trcontrol &lt;- trainControl(
     method = "cv",
     number = 2,                                     
     search = "grid",
     verboseIter = FALSE,
     returnData = FALSE,
     savePredictions = "none",          
     classProbs = TRUE,
     summaryFunction = twoClassSummary,
     sampling = "up",                                # over-sampling
     allowParallel = TRUE
   )
  
   # training
   targetVar = target_fields[i]
   excludeVar = c(ID_fields,targetVar)
   model_train &lt;- train(
     x &lt;- as.matrix(train_data[,!c(excludeVar),with = FALSE]),
     y &lt;- eval(parse(text = paste0("as.factor(train_data$",targetVar,")"))),
     trControl = model_trcontrol,
     tuneGrid = model_grid,
     method = "ranger"
   )
  </code></pre>
  
  <p>The codes work on my local PC Rstudio (when I used a small sample of data), but not on a virtual machine Rstudio.</p>
  
  <p>Any possible reason why it happens? How to fix it?</p>