test_that("basic operation as expected", {
dt <- lazy_dt(data.frame(g = c(1, 1, 2), x = 1:3), "DT")
expect_equal(
dt %>% do(y = ncol(.)) %>% show_query(),
expr(DT[, .(y = .(ncol(.SD)))])
)
expect_equal(
dt %>% group_by(g) %>% do(y = ncol(.)) %>% show_query(),
expr(DT[, .(y = .(ncol(.SD))), keyby = .(g)])
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.