ggplot2: does boxplot use for calculations only values lying within limits of y-axis?

前端 未结 1 571
囚心锁ツ
囚心锁ツ 2021-01-21 09:46

I noticed that median of boxplot (constructed with restricted ylim-parameter) may differ from the median obtained by median()-function or boxplot without adjusted y-axis.

<
1条回答
  •  不思量自难忘°
    2021-01-21 10:13

    Using ylim restricts the scale for y. In ggplot, data that falls outside the scale's limits is discarded and is not included in any statistical computations (such as boxplots). To just zoom the axes without changing the data that is included, use coord_cartesian(ylim=...).

    0 讨论(0)
提交回复
热议问题