The way to compute metrics that give us insight into which variables are important
To view this metric, run the following lines of R code (replace "MODEL" with the name of your random forest model):
vu = varUsed(MODEL, count=TRUE)
vusorted = sort(vu, decreasing = FALSE, index.return = TRUE)
dotchart(vusorted$x, names(MODEL$forest$xlevels[vusorted$ix]))
#varUsed is Variables used in a random forest, to find out which predictor variables are actually used in the random forest.
This code produces a chart that for each variable measures the number of times that variable was selected for splitting (the value on the x-axis). you can check the pic.