Hi guys,
I want to adjust the number of significant values that is shown in my mean labels, but this mean is computed from a data-frame (fun.data).
This is how my code looks like:
scoresforplotting <- cbind(intensityValues,groupings)
averagesforplotting <- function(x){
return(c(y=mean(x), label=mean(x)))
}
ggplot(scoresforplotting, aes(groupings, intensityValues))+geom_boxplot()+stat_summary(fun.data=averagesforplotting,geom="text")
The aes argument in ggplot nicely handles the grouping. However the stat_summary part is what I am stuck at. The function averagesforplotting would help me to compute the group means, but however the means have too many significant figures. Can someone provide some lead as to how I can go about with reducing the number of significant figures that is shown on the labels?
Thanks!
Jeremy