is_same_as_last | R Documentation |
Check for locally repeating values
is_same_as_last(xs) replace_if_same_as_last(xs, replacement = "")
xs |
a vector |
replacement |
a value used to replace a repeated value. Defaults to
|
is_same_as_last()
returns TRUE when xs[n]
the same as xs[n-1]
.
xs <- c("a", "a", "a", NA, "b", "b", "c", NA, NA) is_same_as_last(xs) replace_if_same_as_last(xs, "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.