title: Unused Argument in Random Forest Algorithm
body: <p>I do not understand why I am receiving this message:</p>
  
  <p><em>Error in train(Medal ~ ., data = training1, method = "rf", ntree = 5) : 
    unused arguments (data = training1, method = "rf", ntree = 5)</em></p>
  
  <p>in my random forest algorithm. I have run a RF exactly like this before but am just now getting this error. Any ideas?</p>
  
  <pre><code>library(caret)
  library(randomForest)
  
  OlympicData &lt;- read.csv(file.choose(), header = T)
  
  #convert NAs in Medal column to NoMedal
  levels &lt;- levels(OlympicData$Medal)
  levels[length(levels) + 1] &lt;- "NoMedal"
  OlympicData$Medal &lt;- factor(OlympicData$Medal, levels = levels)
  OlympicData$Medal[is.na(OlympicData$Medal)] &lt;- "NoMedal"
  summary(OlympicData)
  
  #remove unnecessary columns
  OlympicData &lt;- OlympicData[, -1]
  OlympicData &lt;- OlympicData[,-1]
  OlympicData &lt;- OlympicData[, -7]
  OlympicData &lt;- OlympicData[, -6]
  summary(OlympicData)
  
  #remove remaining NAs
  OlympicData[complete.cases(OlympicData),]
  
  #train model
  set.seed(33)
  Data_Splitting &lt;- createDataPartition(OlympicData$Medal, p=0.75, list=FALSE)
  training1 = OlympicData[Data_Splitting,]
  testing1 = OlympicData[-Data_Splitting,]
  
  rf &lt;- train(Medal ~., data = training1, method = "rf", ntree = 5)
  </code></pre>