R: why is boxplot(x,log=“y”) different from boxplot(log(x))?

坚强是说给别人听的谎言 提交于 2019-12-23 19:59:23

问题


delme <- exp(rnorm(1000,1.5,0.3))
boxplot(delme,log="y")
boxplot(log10(delme))

Why are the whiskers different in this 2 plots?

Thanks Agus


回答1:


I would say that in your first plot you just changed the y axis to log, so the values you plot still range between 1 and 10. In this plot the y axis is a log scale. The whiskers on this axis look different because the space between each "tick" (ie axis break) is not constant (there is more space between 2 and 4 than between 10 and 8)

In the second plot, you take the log of the values then plot them, so they range from .2 to 1, and are plotted with a linear y axis.

Look at the summary for both of the normal and log transformed dataframes



来源:https://stackoverflow.com/questions/28296634/r-why-is-boxplotx-log-y-different-from-boxplotlogx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!