-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9da9d8
commit 98a7e4c
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# xwalk functions work | ||
|
||
Code | ||
acs_data_interp | ||
Output | ||
# A tibble: 1 x 22 | ||
NAME variable column_id table_id estimate moe perc_estimate perc_moe | ||
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> | ||
1 9504 B01003_001 B01003001 B01003 2748 272 NA NA | ||
# i 14 more variables: geography <chr>, table_title <chr>, | ||
# simple_table_title <chr>, subject_area <chr>, universe <chr>, | ||
# denominator_column_id <chr>, topics <chr>, line_number <dbl>, | ||
# column_title <chr>, indent <dbl>, parent_column_id <chr>, | ||
# denominator_estimate <dbl>, denominator_moe <dbl>, | ||
# denominator_column_title <chr> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
test_that("xwalk functions work", { | ||
skip_if_not_installed("sf") | ||
|
||
block_xwalk <- make_block_xwalk( | ||
state = "MD", | ||
county = "Kent County" | ||
) | ||
|
||
expect_s3_class(block_xwalk, "sf") | ||
|
||
area_xwalk <- make_area_xwalk( | ||
area = sf::st_buffer(xwalk[1,], dist = 5000), | ||
block_xwalk = block_xwalk | ||
) | ||
|
||
expect_s3_class(area_xwalk, "tbl_df") | ||
|
||
acs_data <- get_acs_tables( | ||
geography = "tract", | ||
state = "MD", | ||
county = "Kent County", | ||
table = "B01003", | ||
year = 2022 | ||
) | ||
|
||
acs_data_interp <- use_area_xwalk( | ||
data = acs_data, | ||
area_xwalk = area_xwalk | ||
) | ||
|
||
expect_snapshot( | ||
acs_data_interp | ||
) | ||
}) |