# generate a predictor matrix
pred <- mice::quickpred(mice::nhanes)
# plot predictor matrix for all columns
plot_pred(pred)
# plot predictor matrix for specific columns by supplying a character vector
plot_pred(pred, c("chl", "hyp"))
# plot predictor matrix for specific columns by supplying unquoted variable names
plot_pred(pred, c(chl, hyp))
# plot predictor matrix for specific columns by passing an object with variable names
# from the environment, unquoted with `!!`
my_variables <- c("chl", "hyp")
plot_pred(pred, !!my_variables)
# object with variable names must be unquoted with `!!`
try(plot_pred(pred, my_variables))
# plot predictor matrix of mids object
imp <- mice::mice(mice::nhanes, print = FALSE)
plot_pred(imp)
Run the code above in your browser using DataLab