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
ggplot removing data without warnings #2879
Comments
|
Generally, this issue is not limited to the cases with Here's a minimal reprex to show what happens. The reason why the most right and left bars disappear is that they are beyond the limits and the default You can change the behaviour by specifying library(ggplot2)
d <- data.frame(x = 1:5, y = 1:5)
p <- ggplot(d, aes(x, y)) + geom_col()
p + scale_x_continuous(limits = c(1, 5))
#> Warning: Removed 2 rows containing missing values (geom_col).p + scale_x_continuous(limits = c(1, 5), oob = scales::squish)Created on 2018-09-05 by the reprex package (v0.2.0). |
|
If it is related to #2715 then the warning was added only after 3.0.0 was released. |
|
Reprex of the original code example. There's a warning in the current development branch. library(tidyverse)
dat <- tibble(
date = as.Date(40100:40129, origin = "1899-12-30"),
rainfall = rnorm(30, 4)
)
ggplot(dat, aes(date, rainfall)) +
geom_bar(stat = "identity") +
scale_x_date(
date_breaks = "1 day",
limits = c(min(dat$date), max(dat$date))
)
#> Warning: Removed 2 rows containing missing values (geom_bar).Created on 2018-09-04 by the reprex package (v0.2.0). |
|
Ah, thanks! I didn't notice the change... |
|
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |



Here's a data frame with dates and some random data.
When you plot the data the 30th value is not included on the graph. Once you execute the code notice that there is no bar above the date 2009-11-12. I'd also expect a warning in my console that data was removed from the plot, not sure why I don't get one.
The text was updated successfully, but these errors were encountered: