tests/testthat/unit/test-chain.R

context("  Chain")

test_that("Chaining expression builders works.", {
    expected <- DT[vs == 0L][order(mpg)]

    ans <- DT %>% start_expr %>% where(vs == 0L) %>% chain %>% order_by(mpg) %>% end_expr
    expect_identical(ans, expected)

    data.table::setindex(DT, NULL)
})

Try the table.express package in your browser

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

table.express documentation built on April 3, 2023, 5:43 p.m.