gpt4 book ai didi

r - 如何使用R ggplot stat_summary绘制中位数和四分位数?

转载 作者:行者123 更新时间:2023-12-04 12:00:36 25 4
gpt4 key购买 nike

如何将此统计摘要图中的上下点更改为25%四分位数和75%四分位数?

ggplot(data = diamonds) + stat_summary(
mapping = aes(x = cut, y = depth),
fun.ymin = min,
fun.ymax = max,
fun.y = median
)

最佳答案

ggplot(data = diamonds) + stat_summary(
mapping = aes(x = cut, y = depth),
fun.min = function(z) { quantile(z,0.25) },
fun.max = function(z) { quantile(z,0.75) },
fun = median)
Diamonds

关于r - 如何使用R ggplot stat_summary绘制中位数和四分位数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41077199/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com