Skip to content

Conflict between base::is.element() and ggplot2::is.element() #6157

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

Closed
teunbrand opened this issue Oct 24, 2024 · 0 comments · Fixed by #6160
Closed

Conflict between base::is.element() and ggplot2::is.element() #6157

teunbrand opened this issue Oct 24, 2024 · 0 comments · Fixed by #6160
Labels
bug an unexpected problem or unintended behavior

Comments

@teunbrand
Copy link
Collaborator

In #6022, we introduced the is.element() function to test if some object is an element_rect(), element_text(), element_blank() etc.:

ggplot2/R/theme-elements.R

Lines 205 to 207 in ddd207e

#' @export
#' @rdname is_tests
is.element <- function(x) inherits(x, "element")

However, there is also base::is.element(), which acts as %in%. Since it is unlikely that base will rename that function anytime soon, we might have to come up with an alternative name for testing if an object is any of the theme elements. Should we just use is.theme_element()?

@teunbrand teunbrand added the bug an unexpected problem or unintended behavior label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant