Remove the conditional formatting from a highlighted vector,
returning the highlight to it's underlying class. If x
is a highlightable
vector, then x
and un_highlight(highlight(x))
are equivalent.
This is useful to expose a highlighted vector's data to function which do not
accept a vlightr_highlight
class object.
ul()
and un_highlight()
are synonyms.
Examples
# Remove the conditional formatting of a highlighted vector
x <- highlight(1:5, ~ .x > 3, wrap())
print(x)
#> <highlight<integer>[5]>
#> [1] 1 2 3 [4] [5]
print(un_highlight(x))
#> [1] 1 2 3 4 5
# Allow a highlighted vector to be used in functions
try(paste(x))
#> Error in as.character(structure(list(.data = 1:5), tests = list(structure(function (..., :
#> Can't convert `x` <highlight<integer>> to <character>.
paste(ul(x))
#> [1] "1" "2" "3" "4" "5"