Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2023 tax bills #41

Merged
merged 8 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 11 additions & 7 deletions data-raw/sample_tax_bills/sample_tax_bills_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

# Different tax bills can have different table sizes depending on the number of
# taxing district.
extract_tax_bill <- function(file) {

extract_tax_bill <- function(file){

Check warning on line 30 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=30,col=35,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 30 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=30,col=35,[paren_body_linter] There should be a space between a right parenthesis and a body expression.
base_file <- basename(file)
tbl <- pdf_text(file)[[1]] %>%
tbl <- pdf_text(file) %>%
paste(., collapse='\n') %>%

Check warning on line 33 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=33,col=22,[infix_spaces_linter] Put spaces around all infix operators.

Check warning on line 33 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=33,col=23,[quotes_linter] Only use double-quotes.
str_extract(., regex("MISCELLANEOUS TAXES.*", dotall = TRUE)) %>%
str_split(., "\n") %>%
unlist() %>%
Expand All @@ -46,12 +48,12 @@
agency_name = str_squish(agency_name),
flag = is.na(prev_tax),
prev_tax = if_else(flag,
pension,
prev_tax
pension,
prev_tax
),
pension = if_else(flag,
NA,
pension
NA,
pension
)
) %>%
select(-flag) %>%
Expand All @@ -61,7 +63,8 @@
agency_name,
paste0(
"TAXES|Assess|Property|EAV|Local Tax|",
"Total Tax|Do not|Equalizer|cookcountyclerk.com"
"Total Tax|Do not|Equalizer|cookcountyclerk.com|",
"Pursuant|meaning of|If paying later|\\d{15}+|By \\d{2}/"
)
)
)
Expand All @@ -76,6 +79,7 @@
return(out)
}


# Collect all scanned tables + meta data in a data frame
bills <- map(list_pdf_inputs, extract_tax_bill)
bills_df <- bind_rows(bills)
Expand Down
4 changes: 2 additions & 2 deletions data-raw/sample_tax_bills/sample_tax_bills_detail.csv
Git LFS file not shown
Binary file modified data/sample_tax_bills_detail.rda
Binary file not shown.
Loading