test_that("can add column at any position", {
df1 <- data.frame(a = 3, b = 4, c = 5)
df2 <- data.frame(X = 1, Y = 2)
at_pos <- function(i) {
insert_into(df1, df2, where = i)
}
expect_named(at_pos(1), c("X", "Y", "a", "b", "c"))
expect_named(at_pos(2), c("a", "X", "Y", "b", "c"))
expect_named(at_pos(3), c("a", "b", "X", "Y", "c"))
expect_named(at_pos(4), c("a", "b", "c", "X", "Y"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.