tests/testthat/test-find_change_location.R

# generate a vector containing different values
v <- c("a", "a", "b", "c", "c")

test_that("multiplication works", {
    expect_equal(find_change_location(v), c(1, 3, 4))
})

v_test <- {}
test_that(
    "check error for find_change_location",
    {
        expect_error(
            find_change_location(v_test),
            "The vector need to have length > 1."
        )
    }
)

Try the MRTAnalysis package in your browser

Any scripts or data that you put into this service are public.

MRTAnalysis documentation built on Sept. 9, 2025, 5:41 p.m.