test_that("location in partition", {
t <- c(0.1, 1.1, 2.1, 3, 4, 5)
p1 <- c(0, 1, 2, 3, 4, 5)
p2 <- c(0, 1, 2, 3, 4, 5, 6)
p3 <- c(0, 0.5, 1, 1.5, 2)
expect_identical(
partition_location(t, p1),
c(1, 2, 3, 3, 4, 5)
)
expect_identical(
partition_location(t, p2),
c(1, 2, 3, 3, 4, 5)
)
expect_identical(
partition_location(t, p3),
c(1, 3, 5, 5, 5, 5)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.