How to manipulate y-axis text labels in R varImpPlot?
r
Solution
I tried to use `adj` parameter but it produces a bug. As varImpPlot , use `dotchart` behind, Here a version using lattice `dotplot`. Then you can customize you axs using `scales` parameters.
imp <- importance(myref, class = NULL, scale = TRUE, type = 2)
dotplot(imp, scales=list(y =list(cex=2,
at = c(1,2),
col='red',
rot =20,
axs='i') ,
x =list(cex=2,col='blue')) )
Problem
The following sample resembles my dataset: ``` require(randomForest) alpha = c(1,2,3,4,5,6) bravo = c(2,3,4,5,6,7) charlie = c(2,6,5,3,5,6) mydata = data.frame(alpha,bravo,charlie) myrf = randomForest(alpha~bravo+charlie, data = mydata, importance = TRUE) varImpPlot(myrf, type = 2) ``` I cannot seem to control the placement of the y-axis labels in `varImpPlot`. I have tried altering the plot parameters (e.g. mar, oma), with no success. I need the y-axis labels shifted to the left in order to produce a PDF with proper label placement. How can I shift the y-axis labels to the left?