Learn R Programming

tornado (version 0.1.3)

plot.importance_plot: Plot an Importance Plot object

Description

Plot an Importance Plot object

Usage

# S3 method for importance_plot
plot(
  x,
  plot = TRUE,
  nvar = NA,
  col_imp_alone = "#69BE28",
  col_imp_cumulative = "#427730",
  geom_bar_control = list(fill = "#69BE28"),
  ...
)

Value

the plot

Arguments

x

a importance_plot object

plot

boolean to determine if the plot is displayed, or just returned

nvar

the number of variables to plot in order of importance

col_imp_alone

the color used for the variance explained by each variable alone

col_imp_cumulative

the color used for the cumulative variance explained

geom_bar_control

list of arguments to control the plotting of ggplot2::geom_bar

...

future arguments

Examples

Run this code
gtest <- lm(mpg ~ cyl + wt + hp + gear + carb, data = mtcars)
gtestreduced <- lm(mpg ~ 1, data = mtcars)
imp <- importance(gtest, gtestreduced)
plot(imp)

gtest <- survival::survreg(survival::Surv(futime, fustat) ~ ecog.ps*rx + age,
                           data = survival::ovarian,
                           dist = "weibull")
imp <- importance(gtest, survival::ovarian, nperm = 50)
plot(imp)

Run the code above in your browser using DataLab