test_df <- head(mtcars, 10)
Highlight locations in a numeric vector which match an expression.
[ 1] 9 8 7 3 9 3 3 6 6 10 9 10 6 8 5 7 6 1 8 5 3 9 6 10 9 [26] 8 10 8 4 9
Colour a numeric vector using a ggplot colour scale.
sample(10, 30, replace = TRUE, prob = 1:10) %>%
sort() %>%
hl_vec(scale_colour_viridis_c(option = 'A'))
[ 1] 1 3 3 3 3 4 5 5 6 6 6 6 6 7 7 8 8 8 8 8 9 9 9 9 9 [26] 9 10 10 10 10
Highlight elements of a vector when they are identical to the previous element.
[ 1] "e" "d" "d" "b" "e" "b" "a" "c" "c" "e" "e" "e" "c" "d" "c" "d" "c" "a" "d" [20] "c" "a" "e" "c" "e" "e" "d" "e" "d" "b" "d"
sample(letters[1:5], 30, replace = TRUE, prob = 1:5) %>%
hl_vec(scale_colour_viridis_d(), show_legend = TRUE)
[ 1] "e" "d" "d" "b" "e" "b" "a" "c" "c" "e" "e" "e" "c" "d" "c" "d" "c" "a" "d" [20] "c" "a" "e" "c" "e" "e" "d" "e" "d" "b" "d" legend: a b c d e