R/functions.R
count_vec.Rd
count a vector of elements, arragange it or not, and returns a tibble
count_vec(vec, sort_n = TRUE)
vec <- s2v("a a b c a b a z z z c d e")
vec |> count_vec()
#> # A tibble: 6 × 2
#> x freq
#> <chr> <int>
#> 1 a 4
#> 2 z 3
#> 3 b 2
#> 4 c 2
#> 5 d 1
#> 6 e 1