tests/testthat/test-calculate_pop_weighted_score.R

test_that("multiplication works", {
  test_data <- tibble::tribble(
    ~group, ~score, ~population,
    "A", 0.5, 100,
    "A", 0.5, 200
  )

  test_data_aggregated <-
    test_data |>
    calculate_pop_weighted_score(score, group, population)

  expect_equal(test_data_aggregated$Score, 0.5)
})

Try the IMD package in your browser

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

IMD documentation built on Sept. 30, 2022, 5:06 p.m.