Learn R Programming

tidytidbits (version 0.3.2)

sequential_duplicates: Detect sequential duplicates

Description

Detect sequential duplicates

Usage

sequential_duplicates(strings, ordering = NULL)

Arguments

strings

Character vector

ordering

Optional: treat strings as if ordered like strings[ordering], or, if a function, strings[ordering(strings)]

Value

A logical vector which indicates if a string is identical to the previous string.

Examples

Run this code
# NOT RUN {
# return c(F, T, F, T, T, F)
sequential_duplicates(c("a", "a", "b", "b", "b", "a"))
# }

Run the code above in your browser using DataLab