Skip to contents
library(vlightr)
library(lubridate, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)
library(ivs)

vlightr makes it easy to identify the elements of a vector that you care about.

# Which numbers are above the mean?
above_mean <- highlight(1:10, ~ .x > mean(.x), ~ paste0("[", .x, "]"))
print(above_mean)
#> <highlight<integer>[10]>
#>  [1] 1    2    3    4    5    [6]  [7]  [8]  [9]  [10]

Including observations in a tibble.

tibble(x = above_mean[1:5])
#> # A tibble: 5 × 1
#>           x
#>   <hl<int>>
#> 1         1
#> 2         2
#> 3         3
#> 4       [4]
#> 5       [5]