Closed pn317 closed 3 weeks ago
In the help file for geom_rug(), it states that missing values are removed with a warning if na.rm = FALSE.
geom_rug()
na.rm = FALSE
This does not seem to be the case.
Example
library("ggplot2") mtcars2 <- mtcars mtcars2$mpg <- ifelse(runif(nrow(mtcars2)) < 0.2, NA, mtcars2$mpg) ggplot(mtcars2, aes(x = wt, y = mpg)) + geom_point() + geom_rug()
In the example, a warning is generated from geom_point() but not from geom_rug().
geom_point()
I think this is because x and y are both optional_aes in GeomRug, but the default Geom$handle_na() only passes required_aes and non_missing_aes to remove_missing().
x
y
optional_aes
GeomRug
Geom$handle_na()
required_aes
non_missing_aes
remove_missing()
I will submit a pull request
Considered fixed by #5906.
In the help file for
geom_rug()
, it states that missing values are removed with a warning ifna.rm = FALSE
.This does not seem to be the case.
Example
In the example, a warning is generated from
geom_point()
but not fromgeom_rug()
.I think this is because
x
andy
are bothoptional_aes
inGeomRug
, but the defaultGeom$handle_na()
only passesrequired_aes
andnon_missing_aes
toremove_missing()
.I will submit a pull request