-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New warning missing values or values outside the scale range
with geom_area(position = position_fill())
#6338
Comments
Hi Jan! I don't think the similarity of the error message is sufficient to implicate #6211 or #6269. I'm reasonably sure that the change you're seeing is because of #6244. The data does contain missing values (note the first library(ggplot2)
p <- mtcars |>
ggplot(aes(x = am, y = gear, fill = cyl, group = cyl)) +
geom_area(position = position_fill())
layer_data(p) |> head()
#> fill x y group PANEL align_padding flipped_aes ymin ymax xmin
#> 1 #132B43 -0.002 NA 1 1 TRUE FALSE NA NA -0.002
#> 2 #132B43 -0.001 1 1 1 FALSE FALSE 0.6000000 1 -0.001
#> 3 #132B43 0.000 1 1 1 FALSE FALSE 0.7000000 1 0.000
#> 4 #132B43 0.001 1 1 1 FALSE FALSE 0.6999900 1 0.001
#> 5 #132B43 0.999 1 1 1 FALSE FALSE 0.6923077 1 0.999
#> 6 #132B43 1.000 1 1 1 FALSE FALSE 0.7142857 1 1.000
#> xmax colour linewidth linetype alpha
#> 1 -0.002 NA 0.5 1 NA
#> 2 -0.001 NA 0.5 1 NA
#> 3 0.000 NA 0.5 1 NA
#> 4 0.001 NA 0.5 1 NA
#> 5 0.999 NA 0.5 1 NA
#> 6 1.000 NA 0.5 1 NA Created on 2025-02-19 with reprex v2.1.1 |
Hey Teun! Thank you very much for your prompt reply! The option However, I am still not sure where the missing values are actually coming from. Consider the following simplified example.
|
So Lines 224 to 228 in d835cfe
From the code above we can anticipate a 'divide by zero' error, and However, it might make sense to avoid the divide by zero error too. I'll take that to be the action prompted by this issue then. |
Sounds great. Thanks again! |
Dear @teunbrand
I am struggling to wrap my head around this new warning message that occurs with ggplot2
v3.5.1.9000
but notv3.5.1
.This might be connected to #6211 and #6269, which report the same warning message but in different contexts.
Best
Jan
The text was updated successfully, but these errors were encountered: