Description Usage Arguments Value Examples
If a string's ratio of alphanumeric characters to total characters is less than 50%, the string is garbage. From https://github.com/foodoh/rmgarbage
1 | rmg_bad_alnum_ratio(x, threshold = 0.5)
|
x |
a character vector |
threshold |
a value between 0 and 1 for the alphanumeric to puncutation ratio |
Logical
1 2 3 4 5 6 7 8 9 10 | garbage_string_r1 <-
paste0(stringi::stri_rand_strings(1, 2, pattern = "[a-zA-Z0-9]"),
"14.9˜;tv˜;<F~~~~9er&é(er@@|^˜:..", # this is garbage
collapse = "")
garbage_string_r2 <-
stringi::stri_rand_strings(1, 10, pattern = "[a-zA-Z0-9]")
rmg_bad_alnum_ratio(garbage_string_r1) # TRUE
rmg_bad_alnum_ratio(garbage_string_r2) # FALSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.