My code is sth like this
<code>ggplot(tx, aes(x=level2Name,y=log(var))) +
stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3,show_guide = FALSE)
</code>
<code>ggplot(tx, aes(x=level2Name,y=log(var))) +
stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3,show_guide = FALSE)
</code>
ggplot(tx, aes(x=level2Name,y=log(var))) +
stat_summary(fun.y=mean, colour="darkred", geom="point", shape=18, size=3,show_guide = FALSE)
you’ll notice i use log(var) rather than var itself. I can not use scale to logarithmize my data, because I’m using boxplot later on and i want my whiskers over log data.
The problem is that stat_summary is now mean(log(var)) rather than log(mean(var)). Is there a way to achieve what i want?
0
You can simply use a different summary function. Use
<code>stat_summary(fun.y=function(x) log(mean(exp(x))), ...)
</code>
<code>stat_summary(fun.y=function(x) log(mean(exp(x))), ...)
</code>
stat_summary(fun.y=function(x) log(mean(exp(x))), ...)