powered by
Plot Variable Importance in Projection (VIP)
plot_pls_vip( object, comps = NULL, threshold = 1, palette = c("#4575b4", "#d73027"), ... )
Invisibly returns the VIP scores used to create the bar plot.
A fitted PLS model.
Components to aggregate. Defaults to all available.
Optional threshold to highlight influential variables.
Colour palette used for bars.
Additional parameters passed to graphics::barplot().
graphics::barplot()
set.seed(123) X <- matrix(rnorm(40), nrow = 10) y <- X[, 1] - 0.5 * X[, 2] + rnorm(10, sd = 0.1) fit <- pls_fit(X, y, ncomp = 2, scores = "r") plot_pls_vip(fit)
Run the code above in your browser using DataLab