Skip to content

Commit c127a69

Browse files
committed
all tracts for property code enforcements
1 parent cf70eb6 commit c127a69

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

inst/codec_data/property_code_enforcements/property_code_enforcements.R

+20-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,27 @@ property_code_enforcements <-
3939
left_join(addr_per_tract, by = "census_tract_id_2010") |>
4040
mutate(violations_per_addr = n_violations/n_addr)
4141

42+
all_tracts <-
43+
cincy::tract_tigris_2010 |>
44+
sf::st_drop_geometry() |>
45+
as_tibble() |>
46+
mutate(date = list(seq.Date(
47+
from = as.Date("2001-04-01"),
48+
to = as.Date("2024-07-01"),
49+
by = "month"
50+
))) |>
51+
tidyr::unnest(cols = c(date)) |>
52+
mutate(
53+
year = lubridate::year(date),
54+
month = lubridate::month(date)
55+
) |>
56+
select(-date)
57+
4258
out_dpkg <-
43-
property_code_enforcements |>
59+
left_join(
60+
all_tracts,
61+
property_code_enforcements,
62+
by = c("census_tract_id_2010", "year", "month")) |>
4463
as_codec_dpkg(
4564
name = "property_code_enforcements",
4665
version = "0.1.0",

0 commit comments

Comments
 (0)