Random Forest application with 40+ Predictor Variables I am using R package randomForest to build a Random Forest model for classification. Ultimately, I need to choose one of five programs for a group of individuals based on historical data. The final variable that is being predicted is a categorical "1, 2, 3, 4, or 5" variable.

I need to incorporate 30-40 variables--their importance will also be analyzed-- to reach a decision for each individual. 

I have no problem training a model, initially. Below is a sample data set being trained with R's randomForest package. I am running up-to-date versions of both the package and RStudio.

set.seed(101)
train &lt;- sample(1:nrow(Boston), 300)
Boston.rf &lt;- randomForest(medv~., data = Boston, subset = train)
Boston.rf


My question is: Once I have a model trained, tested, and cross-validated, how do I actually apply new data to this model? Is it viable to use that many variables--all categorical, some binary--for this?
The randomForest package supports various tasks using an existing randomForest object.

For instance, it offers the predict method which will perform prediction using a given trained forest and a given dataset. As an example, if you have a trained forest called mod and a dataset called my_data, predictions can be obtained by running predict(object=mod,newdata=my_data).

It's worth reading through the package documentation which gives good examples of using the functionality.

I would note that any new data you supply to a trained forest object should have the same encodings and transformations as the data used to train the forest with.