sequential_duplicates: Detect sequential duplicates

Description Usage Arguments Value Examples

View source: R/purrr-like.R

Description

Detect sequential duplicates

Usage

1
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

1
2
# return c(F, T, F, T, T, F)
sequential_duplicates(c("a", "a", "b", "b", "b", "a"))

tidytidbits documentation built on March 8, 2021, 5:07 p.m.