Skip to content

geom_rug() does not print a warning when na.rm = FALSE #5905

Closed
@pn317

Description

@pn317

In the help file for geom_rug(), it states that missing values are removed with a warning if 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().

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().

I will submit a pull request

Metadata

Metadata

Assignees

No one assigned

    Labels

    messagesrequests for improvements to error, warning, or feedback messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions