Skip to content

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

Closed
@teunbrand

Description

@teunbrand

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions