tests/testthat/test-tx_ml.R

test_that("tx_ml subsets only inactive clients within a period", {
  expect_identical(
    tx_ml(
      new_data = ndr_example,
      from = lubridate::ymd("2020-10-01"),
      to = lubridate::ymd("2021-01-31")
    ),
    ndr_example %>%
      dplyr::filter(dplyr::between(
        date_lost,
        lubridate::as_date("2020-10-01"),
        lubridate::as_date("2021-01-31")
      ))
  )
})

Try the tidyndr package in your browser

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

tidyndr documentation built on April 8, 2022, 9:06 a.m.