tests/testthat/test-tabulate_emissions_by.R

context("tabulate_emissions_by")

test_that("tabulate emissions by pol_abbr", {

  tabulated <-
    tabulate_emissions_by(
      ems_and_tput,
      pol_abbr)

  expected <-
    ems_and_tput %>%
    sum_emissions_by(
      pol_abbr) %>%
    tidyr::spread(
      pol_abbr,
      ems_qty) %>%
    dplyr::select(
      PM,
      TOG,
      ems_unit)

  expect_equal(
    tabulated,
    expected)

})
BAAQMD/qtytools documentation built on June 30, 2022, 6:07 p.m.