mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 09:32:10 +01:00
672 B
672 B
Test if element is identical to the previous
Test if element is identical to the previous
Usage
is_identical_to_previous(data, no.name = TRUE)
Arguments
-
data:
data. vector, data.frame or list
-
no.name:
logical to remove names attribute before testing
Value
logical vector
Examples
c(1, 1, 2, 3, 3, 2, 4, 4) |> is_identical_to_previous()
#> [1] FALSE TRUE FALSE FALSE TRUE FALSE FALSE TRUE
mtcars[c(1, 1, 2, 3, 3, 2, 4, 4)] |> is_identical_to_previous()
#> [1] FALSE TRUE FALSE FALSE TRUE FALSE FALSE TRUE
list(1, 1, list(2), "A", "a", "a") |> is_identical_to_previous()
#> [1] FALSE TRUE FALSE FALSE FALSE TRUE