extract the frequency of nodes in a text
Examples
vert <- c(letters[1:7], letters[1:3])
vert
#> [1] "a" "b" "c" "d" "e" "f" "g" "a" "b" "c"
text <- paste(vert, collapse = " ")
freq_nodes(vert, text)
#>
|
| | 0%
|
|======= | 10%
|
|============== | 20%
|
|===================== | 30%
|
|============================ | 40%
|
|=================================== | 50%
|
|========================================== | 60%
|
|================================================= | 70%
|
|======================================================== | 80%
|
|=============================================================== | 90%
|
|======================================================================| 100%
#> # A tibble: 7 × 2
#> x freq
#> <chr> <int>
#> 1 a 4
#> 2 b 4
#> 3 c 4
#> 4 d 1
#> 5 e 1
#> 6 f 1
#> 7 g 1