Skip to contents

Predicate that returns TRUE if x carries the shared "pmx_element" class – i.e., it was constructed by one of pmx_point(), pmx_line(), pmx_ribbon(), pmx_errorbar(), pmx_trend(), pmx_style(), or pmx_color(). For a specific-type check, use inherits(x, "pmx_point") (or whichever type) directly.

Usage

is_pmx_element(x)

Arguments

x

Object to test.

Value

Logical scalar.

See also

Other pmx theme class: is_pmx_theme(), pmx_theme()

Examples

is_pmx_element(pmx_point(shape = 1))     # TRUE
#> [1] TRUE
is_pmx_element(pmx_line(linewidth = 1))  # TRUE
#> [1] TRUE
is_pmx_element(list(shape = 1))          # FALSE
#> [1] FALSE
inherits(pmx_point(), "pmx_point")       # TRUE -- specific-type check
#> [1] TRUE