Test if element is identical to the previous
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