variable importance plot

Share:

Description

This function plots varible importances using a barplot.

Usage

1
2
viplot(varimp, xlab, xlab.mar = 5, ylab.mar = 4, xlab.srt = 90, 
xlab.cex = 1, sort = FALSE, ...)

Arguments

varimp

A numeric vector, variable importances.

xlab

A vector of strings. Labels to be plotted on x-axis.

xlab.mar

A positive value. The margin reserved for x-axis labels.

ylab.mar

A positive value, The margin reserved for y-axis labels.

xlab.srt

A numeric value, amount of rotation of the x-axis labels.

xlab.cex

A positive value, magnitude of x-axis labels.

sort

A logical value, TRUE if sorted variables should be plotted.

...

The barplot options.

Details

It is not strightforward to rotate x labels of a barplot. This function does it easily.

See Also

imp, dptplot, ditplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(gaelle)
gaelle.bclust<-bclust(gaelle,
transformed.par=c(-1.84,-0.99,1.63,0.08,-0.16,-1.68))
gaelle.imp<-imp(gaelle.bclust)
viplot(varimp=gaelle.imp$var)
# solid plot 

viplot(varimp=gaelle.imp$var,xlab=imp(gaelle.bclust)$labels,
sort=TRUE,col=heat.colors(length(gaelle.imp$var))) 
# sorted plot with heat colors and labels