openjusticeok / ojodb

OJO's R package for opening the black box of our justice system
https://openjusticeok.github.io/ojodb/
GNU General Public License v3.0
5 stars 3 forks source link

Fixed add_counts to pull from open_counts and count_as filed #62

Closed brancengregory closed 2 years ago

brancengregory commented 2 years ago

This makes ojo_crim_cases() return a tibble that has counts included for both OSCN and ODCR. There is one row per count. You can't nest by id to get one row per case like I'd want, but I think this is preferable since it returns a lazy tibble. That way the analyst chooses when to collect. They can always do ojo_crim_cases() |> collect() |> group_by(id) |> nest(counts_as_filed = count_as_filed)