A wrapper around the magrittr::%>%
pipe which
un-highlights the input value using un_highlight(lhs)
and re-highlights
the output value using re_highlight(..., lhs)
.
Examples
# Make a highlighted vector
x <- highlight(c(1L, 0L, NA, 0L), is.na, color("red"))
print(x)
#> <highlight<integer>[4]>
#> [1] 1 0 NA 0
# The following are equivalent
re_highlight(as.logical(un_highlight(x)), x)
#> <highlight<logical>[4]>
#> [1] TRUE FALSE NA FALSE
x |> un_highlight() |> as.logical() |> re_highlight(x)
#> <highlight<logical>[4]>
#> [1] TRUE FALSE NA FALSE
x %hl>% as.logical()
#> <highlight<logical>[4]>
#> [1] TRUE FALSE NA FALSE