r/R_Programming • • Feb 01 '18

GGplot: mean +/- sd

Hello there,

currently exploring ggplot and what I found out yesterday was that you "could" display the mean +/- the standard devaition using stat_summary like this:

...+ stat_summary(fun.data = mean_sdl)

However, now I've found about about this:

...+ stat_summary(fun.data = mean_sdl, fun.args=list(mult=1))

So my question is pretty straight forward:

Which one does actually display mean +/- standard deviation?

Also: I know how to do IQR but how do I display Mean Absolute Deviation in a way similar to how I do mean +/- sd?

3 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Feb 02 '18 edited Feb 02 '18

Alright, I'll just stick to fun.data=mean_sdl , fun.args = list(mult=1) for the mean +/-.

~~When I try to run median_mad with fun.data, it gives me an error, saying the object median_mad was not found. ~~ Didn't realize I had to install and load ggpubr.