View source: R/plot_importance_plot.R
| plot.importance_plot | R Documentation | 
Plot an Importance Plot object
## S3 method for class 'importance_plot'
plot(
  x,
  plot = TRUE,
  nvar = NA,
  col_imp_alone = "#69BE28",
  col_imp_cumulative = "#427730",
  geom_bar_control = list(fill = "#69BE28"),
  ...
)
| x | a  | 
| 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  | 
| ... | future arguments | 
the plot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.