A named vector of values, typically importance scores from models.
x_lab
A character string for the x-axis label.
top_n
The number of top values to show. If NULL, all values are shown.
color
A length-2 vector of low and high colors, or a single color for the bars.
show_legend
A logical value indicating whether to show the legend.
split_at
The index at which to split the plot into two halves, usually used to illustrate
variable selection. If NULL, no split is made.
show_labels
A logical value indicating whether to show the value labels on the bars.
digits, nsmall, scientific
Controls the formatting of labels. Passed to format().
label_color
The color of the labels.
label_size
The size of the labels.
label_hjust
The horizontal justification of the labels.
save_plot
A logical value indicating whether to save the plot.
filename
The filename to save the plot as.
Details
The importance plot is a bar plot that shows the importance of each variable in a model.
The variables are sorted in descending order of importance, and the top_n variables are shown.
If top_n is NULL, all variables are shown. The plot can be split into two halves at a specified
index, which is useful for illustrating variable selection.