jonocarroll / ggeasy

ggplot2 shortcuts (transformations made easy)
https://jonocarroll.github.io/ggeasy/
272 stars 21 forks source link

easy_bar_mean + easy_bar_median + easy_range #49

Closed feddelegrand7 closed 4 years ago

feddelegrand7 commented 4 years ago

Hi, I've tested the functions using vdiffr. Feel free to edit or ignore this pull request.

jonocarroll commented 4 years ago

Thank you!

To be honest I'm not sure we want to try to wrap the entire plotting code. The other functions in the package are mainly wrappers to theme() additions.

More critically, I'm not sure that a bar plot is an appropriate way to represent mean or median at all. I see you have a mean, median, and errorbar version, but I'd instead use a boxplot to expose the range of the data. I've added the mean to this here but I wouldn't usually use that statistic

library(ggplot2)
ggplot(mtcars, aes(factor(am), mpg)) + geom_boxplot() + stat_summary(fun = mean)
#> Warning: Removed 2 rows containing missing values (geom_segment).

Created on 2020-04-12 by the reprex package (v0.3.0)

I do appreciate the PR though, thanks again.

feddelegrand7 commented 4 years ago

Hi, thanks for the feedback. That's ok I understand. The cool thing is that I've discovered the vdiffr package which I didn't heard about before. Really good experience. Keep up !

feddelegrand7 commented 4 years ago

Yeah I totally agree with the box plot aspect but the problem of box plot is that many people are not familiar with them which may create some friction, but yes box plot indeed provide all the necessary info at once.