Skip to content

Commit 267bacd

Browse files
Merge pull request #64 from openjusticeok/v2.0
V2.0
2 parents 8013dab + 0d69ce6 commit 267bacd

File tree

91 files changed

+2465
-65766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2465
-65766
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
^renv$
2+
^renv\.lock$
13
^.*\.Rproj$
24
^\.Rproj\.user$

.Rprofile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source("renv/activate.R")

DESCRIPTION

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
Package: ojodb
22
Type: Package
33
Title: Analyze data from the Open Justice Oklahoma Database
4-
Version: 1.0.3
4+
Version: 2.0.0
55
Author: Ryan Gentzler
66
Maintainer: Ryan Gentzler <rgentzler@okpolicy.org>
77
Description: Provides convenient functions to query court data from the Open Justice Oklahoma database
88
License: MIT + file LICENSE
9-
Depends: tidyverse, RMySQL, lubridate, httr,
10-
rvest, glue, sp, leaflet, dbx
11-
Imports:
9+
Depends:
10+
DBI,
1211
tidyverse,
13-
RMySQL,
12+
pool,
13+
RPostgres,
14+
lubridate,
15+
httr,
16+
rvest,
17+
glue,
18+
sp,
19+
leaflet,
20+
dbx
21+
Imports:
22+
DBI,
23+
tidyverse,
24+
pool,
25+
RPostgres,
1426
lubridate,
1527
httr,
1628
rvest,
@@ -22,6 +34,8 @@ Encoding: UTF-8
2234
LazyData: true
2335
RoxygenNote: 7.1.2
2436
Suggests:
37+
testthat (>= 3.0.0),
2538
knitr,
2639
rmarkdown
2740
VignetteBuilder: knitr
41+
Config/testthat/edition: 3

NAMESPACE

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
exportPattern("^[[:alpha:]]+")
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(connect_ojo)
4+
export(ojo_add_counts)
5+
export(ojo_add_issues)
6+
export(ojo_add_minutes)
7+
export(ojo_auth)
8+
export(ojo_civ_cases)
9+
export(ojo_color)
10+
export(ojo_connect)
11+
export(ojo_crim_cases)
12+
export(ojo_fill)
13+
export(ojo_list_schemas)
14+
export(ojo_list_tables)
15+
export(ojo_list_vars)
16+
export(ojo_pal)
17+
export(ojo_search_minutes)
18+
export(ojo_table)
19+
export(ojo_tbl)
20+
export(ojo_theme)
21+
import(dbplyr)

R/connect_ojo.R

Lines changed: 0 additions & 93 deletions
This file was deleted.

R/doc_current_pop.R

Lines changed: 0 additions & 21 deletions
This file was deleted.

R/eviction_details.R

Lines changed: 0 additions & 93 deletions
This file was deleted.

R/odcr_show.R

Lines changed: 0 additions & 20 deletions
This file was deleted.

R/ojo_add_minutes.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#' Query minutes for a given case
2+
#'
3+
#' Query the Open Justice Oklahoma database for the minutes of a case
4+
#'
5+
#' @export ojo_add_minutes
6+
#' @return data, a lazy tibble containing the resulting cases with minutes
7+
#' @examples
8+
#' \dontrun{
9+
#' ojo_add_minutes()
10+
#' }
11+
#'
12+
13+
ojo_add_minutes <- function(data, ...) {
14+
minutes <- ojo_tbl("minute")
15+
16+
data <- data |>
17+
left_join(minutes,
18+
by = c("id" = "case_id"),
19+
suffix = c("", ".minute"))
20+
21+
return(data)
22+
}
23+
24+

R/ojo_alert_creds.R

Lines changed: 0 additions & 16 deletions
This file was deleted.

R/ojo_case_types.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#' List the case types present in the OJO database
2+
#'
3+
#' Returns a tibble containing all the case types present in the OJO database
4+
#'
5+
#' @return Tibble of case types
6+
#' @examples
7+
#'
8+
#' ojo_case_types()
9+
#'
10+
11+
ojo_case_types <- function() {
12+
ojo_table("case") |>
13+
count(case_type, sort = T) |>
14+
collect()
15+
}

0 commit comments

Comments
 (0)