# NOT RUN {
library(easyalluvial)
# alluvial wide ---------------------------------
p = alluvial_wide(mtcars2, max_variables = 5)
parcats(p, marginal_histograms = FALSE)
parcats(p, marginal_histograms = TRUE, data_input = mtcars2)
# alluvial for model response --------------------
df = mtcars2[, ! names(mtcars2) %in% 'ids' ]
m = randomForest::randomForest( disp ~ ., df)
imp = m$importance
dspace = get_data_space(df, imp, degree = 3)
pred = predict(m, newdata = dspace)
p = alluvial_model_response(pred, dspace, imp, degree = 3)
parcats(p, marginal_histograms = TRUE, imp = TRUE, data_input = df)
# }
Run the code above in your browser using DataLab