Skip to content

Commit

Permalink
fixing minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wcurrangroome committed Mar 13, 2024
1 parent 1404ec0 commit 9805bbb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
4 changes: 2 additions & 2 deletions R/compile_acs_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ geographies over time should be thoroughly quality checked.\n")
"combined statistical area" = tigris::combined_statistical_areas(cb = TRUE, year = year),
"new england city and town area" = tigris::new_england(cb = TRUE, year = year, type = "NECTA")) %>%
dplyr::transmute(
area_land_sq_kilometer = safe_divide(ALAND, 1000000),
area_water_sq_kilometer = safe_divide(AWATER, 1000000),
area_land_sq_kilometer = ALAND / 1000000,
area_water_sq_kilometer = AWATER / 1000000,
area_land_water_sq_kilometer = area_land_sq_kilometer + area_water_sq_kilometer,
GEOID = GEOID,
data_source_year = year) })
Expand Down
20 changes: 0 additions & 20 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,6 @@
],
"Hash": "e0b3a53876554bd45879e596cdb10a52"
},
"here": {
"Package": "here",
"Version": "1.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"rprojroot"
],
"Hash": "24b224366f9c2e7534d2344d10d59211"
},
"hms": {
"Package": "hms",
"Version": "1.1.3",
Expand Down Expand Up @@ -520,16 +510,6 @@
],
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
},
"rprojroot": {
"Package": "rprojroot",
"Version": "2.0.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "4c8415e0ec1e29f3f4f6fc108bef0144"
},
"rvest": {
"Package": "rvest",
"Version": "1.0.3",
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-compile_acs_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ summary_statistics = df %>%
mean = mean(value, na.rm = T),
distinct_values = dplyr::n_distinct(value, na.rm = T))

summary_statistics %>%
dplyr::filter(stringr::str_detect(name, "area"))

testthat::test_that(
"All measures have meaningful values",
{ purrr::map_dbl(summary_statistics$max, ~testthat::expect_gt(.x, 0) )
Expand Down

0 comments on commit 9805bbb

Please sign in to comment.