Package 'oldbailey'

Title: For Accessing the Old Bailey Open Data
Description: Fetch trial data from the Old Bailey Online API <https://www.oldbaileyonline.org/static/DocAPI.jsp>. Data is returned in an analysis-ready data frame with fields for metadata including (but not limited to) the names of the first person speakers, defendants, victims, their recorded genders, verdicts, punishments, crime locations, and dates. Optional parameters allow users to specify the number of results, whether these results contain key terms, and trial dates.
Authors: Steph Buongiorno [aut, cre]
Maintainer: Steph Buongiorno <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2024-10-29 03:15:26 UTC
Source: https://github.com/rOpenGov/oldbailey

Help Index


Find Old Bailey Trials

Description

For finding Old Bailey trial data.

Usage

find_trials(
  n_results = "all",
  cat = NA,
  term = NA
  )

Arguments

n_results

The number of results to return. By default, all results are returned.

cat

Find trials pertaining to a category. (optional).

term

Find trials pertaining to a term. (optional).

Value

Dataframe containing API pull of XML addresses for Old Bailey Trials corresponding with the search criteria.

Examples

# Return a dataframe with 5 trials.
trials <- find_trials(n_results = 5)
head(trials)

# Return a dataframe with 5 trials on deception. 
trials <- find_trials(n_results = 5, cat = "offcat", term = "deception")
head(trials)

View Old Bailey API Terms

Description

For viewing terms and their categories.

Usage

old_bailey_api_terms(
  cat = NULL
  )

Arguments

cat

Return terms corresponding to a category of crime. By default, all terms and categories are returned.

Value

Dataframe containing API pull of terms and their categories.

Examples

# Return a dataframe with the terms corresponding to defendant gender or offensive category.
terms <- old_bailey_api_terms(cat = c("defgen", "offcat"))
head(terms)

Parse Old Bailey Trials

Description

For parsing Old Bailey trial data.

Usage

parse_trials(
  xml_address
  )

Arguments

xml_address

One or more XML addresses. A single XML address can be passed as a string, or numerous XML addresses can be passed as a list.

Value

Dataframe containing API pull of parsed Old Bailey Trials.

Examples

# Return a dataframe with parsed trial data.
xml_address <- "https://www.oldbaileyonline.org/obapi/text?div=t17690112-9"
parsed_trial <- parse_trials(xml_address)
head(parsed_trial)