I have a model generated from a random forest. Inside it, there is a attribute called call, that will give me the what was actually the randomForest called function.
I want to get this parameter, remove one column from the model and run it again.
ex:
library(randomForest)
data(iris)
iris.rf <- randomForest(Species~.-Sepal.Length, data=iris, prox=TRUE)
iris.rf$call
# want to remove the field Sepal.length as well
# the call should be then
# randomForest(Species~.-Sepal.Length-Sepal.Width, data=iris, prox=TRUE)
I have tried converting to a list, pasting the new argument and then adding it again to iris.rf[[2]], but it paste in all parts of the formula.
I cannot get rid of the class call, to change it and then call eval() to run it again.