replace_sequential_duplicates | R Documentation |
Replace sequential duplicates
replace_sequential_duplicates(strings, replace_with = "", ordering = NULL)
strings |
Character vector |
replace_with |
Replacement string |
ordering |
Optional: treat strings as if ordered like strings[ordering], or, if a function, strings[ordering(strings)] |
A character vector with strings identical to the previous string replaced with replace_with
# returns c("a", "", "b", "", "", "a") replace_sequential_duplicates(c("a", "a", "b", "b", "b", "a"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.