boxuancui / DataExplorer

Automate Data Exploration and Treatment
http://boxuancui.github.io/DataExplorer/
Other
512 stars 88 forks source link

Add 'by' argument to plot_bar() etc. #139

Closed jl5000 closed 4 years ago

jl5000 commented 4 years ago

Just like you can use plot_boxplot(df, "response_var"), it would be great if you could do the same for plot_bar() and maybe plot_histogram(), where the "by" variable alters the fill colour.

This will allow plots to be stratified by outcome to quickly understand if there are any variables contributing strongly to the outcome. At the moment I'm having to do it manually in ggplot (it's also really useful seeing it with position = "fill" so you can see relative proportions in bar plots)