Skip to contents

This function returns TRUE for vectors highlighted using highlight_case() or templight_case() (class vlightr_highlight_case), and returns FALSE otherwise.

Usage

is_highlight_case(x)

Arguments

x

An object to test.

Value

TRUE if x is a vlightr_highlight_case, FALSE otherwise.

Examples

# The following are `FALSE`
is_highlight_case(10)
#> [1] FALSE
is_highlight_case(highlight(10))
#> [1] FALSE

# The following are `TRUE`
is_highlight_case(highlight_case(10))
#> [1] TRUE
is_highlight_case(templight_case(10))
#> Error in prepare_templight_functions(...): object 'highlighters_at' not found

# Vectors highlighted using `highlighter_case()` or
# `templigher_case()` highlighter are class `vlightr_highlight_case`
lighter <- highlighter_case()
is_highlight_case(lighter(10))
#> [1] TRUE