gpt4 book ai didi

r - 如何在 ggplot2 中删除点和扩展箱线图

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

<分区>

我有一些数据,我正在尝试使用这些数据构建一些箱线图,但出现此错误:

Warning message: Removed 1631 rows containing non-finite values (stat_boxplot).

没有 NA 值,所有数据似乎都很好。我该如何解决这个问题,因为这些在我的数据中肯定是有值(value)的点,应该通过 mustache 进行扩展?

数据

数据相当大,我无法获得更小的子样本来产生错误,所以我只发布原始数据。

dat.rds

ggplot2

dat <- readRDS("./dat.rds")
ggplot(dat, aes(x = factor(year), y = dev)) + geom_boxplot() + ylim(-40, 260)

enter image description here

编辑

我能够在 boxplot 中使用 `range = 6' 让它工作。有没有办法在 ggplot 中做到这一点?

boxplot(dev~year, data = d, range = 6)

enter image description here

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