R boxplot vs ggplot2 geom_boxplot

时间:2022-06-15 13:06:34

Why are the boxplots so different?

为什么箱形图如此不同?

boxplot(loan.part.value ~ platform, p2p)

R boxplot vs ggplot2 geom_boxplot

ggplot(p2p, aes(loan.part.value, platform)) + geom_boxplot()

R boxplot vs ggplot2 geom_boxplot

(I redacted the tick labels.)

(我编写了刻度标签。)

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_0.9.3.1

1 个解决方案

#1


3  

Because the order is switched in one of your plots. In boxplot the formula is y ~ x where as ggplot2 has the first positional argument of x.

因为订单是在您的一个地块中切换的。在boxplot中,公式为y~x,其中ggplot2具有x的第一个位置参数。

#1


3  

Because the order is switched in one of your plots. In boxplot the formula is y ~ x where as ggplot2 has the first positional argument of x.

因为订单是在您的一个地块中切换的。在boxplot中,公式为y~x,其中ggplot2具有x的第一个位置参数。