powered by
Replace sequential duplicates
replace_sequential_duplicates(strings, replace_with = "", ordering = NULL)
Character vector
Replacement string
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
# NOT RUN { # returns c("a", "", "b", "", "", "a") replace_sequential_duplicates(c("a", "a", "b", "b", "b", "a")) # }
Run the code above in your browser using DataLab