title: Is there a way to enable grid tuning of mtry using Random Forest and PCA pre-processing in train function from Caret?
body: <p>When I use Random Forest with PCA pre-processing with the train function from Caret package, if I add a <code>expand.grid(ncomp=c(2,5,10,15))</code>, I need to provide also a grid for mtry.</p>
  
  <pre><code>res &lt;- train(Y~., data=df, method="icr", preProc = c("center",
  "scale"), tuneGrid = expand.grid(n.comp = c(2,5,10,15))))
  </code></pre>
  
  <p>I would rather not provide it and let it work as it is when I perform the same Random Forest with PCA pre-processing without specifying any <code>expand.grid</code>.</p>
  
  <pre><code>res &lt;- train(Y~., data=df, method="icr", preProc = c("center",
  "scale")))
  </code></pre>
  
  <p>Does any one know how I can solve this ?</p>
  
  <p>Many Thanks</p>