Title: | For Accessing U.S. Department of Justice (DOJ) Open Data |
---|---|
Description: | Fetch data from the <https://www.justice.gov/developer/api-documentation/api_v1> API such as press releases, blog entries, and speeches. Optional parameters allow users to specify the number of results starting from the earliest or latest entries, and whether these results contain keywords. Data is cleaned for analysis and returned in a dataframe. |
Authors: | Steph Buongiorno [aut, cre] |
Maintainer: | Steph Buongiorno <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-11-09 05:23:23 UTC |
Source: | https://github.com/rOpenGov/usdoj |
For accessing U.S. Department of Justice (DOJ) open data blog entries.
doj_blog_entries( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
doj_blog_entries( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
n_results |
The number of results to return. By default, 50 results are returned. |
search_direction |
Set to ASC or DESC to fetch data starting from the most or least recent entries. By default, data is sorted in descending order (the most recent entries). |
keyword |
Only return results containing a keyword. Keyword can be a single word, a list or words, or a regex separated by the pipe delimiter |
clean |
Set to FALSE to return data without additional cleaning. By default HTML tags, white space, line breaks, and other messy characters are removed. Epoch time is converted to year-month-day format. |
Dataframe containing API pull of U.S. DOJ blog entries.
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_blog_entries() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_blog_entries(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_blog_entries() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_blog_entries(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)
For accessing U.S. Department of Justice (DOJ) open data press releases.
doj_press_releases( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
doj_press_releases( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
n_results |
The number of results to return. By default, 50 results are returned. |
search_direction |
Set to ASC or DESC to fetch data starting from the most or least recent entries. By default, data is sorted in descending order (the most recent entries). |
keyword |
Only return results containing a keyword. Keyword can be a single word, a list or words, or a regex separated by the pipe delimiter |
clean |
Set to FALSE to return data without additional cleaning. By default HTML tags, white space, line breaks, and other messy characters are removed. Epoch time is converted to year-month-day format. |
Dataframe containing API pull of U.S. DOJ press releases.
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_press_releases() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_press_releases(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_press_releases() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_press_releases(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)
For accessing U.S. Department of Justice (DOJ) open data speeches.
doj_speeches( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
doj_speeches( n_results = 50, search_direction = "DESC", keyword = NULL, clean = TRUE )
n_results |
The number of results to return. By default, 50 results are returned. |
search_direction |
Set to ASC or DESC to fetch data starting from the most or least recent entries. By default, data is sorted in descending order (the most recent entries). |
keyword |
Only return results containing a keyword. Keyword can be a single word, a list or words, or a regex separated by the pipe delimiter |
clean |
Set to FALSE to return data without additional cleaning. By default HTML tags, white space, line breaks, and other messy characters are removed. Epoch time is converted to year-month-day format. |
Dataframe containing API pull of U.S. DOJ speeches.
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_speeches() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_speeches(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)
# Return a dataframe with 50 of the latest records. Data is cleaned. latest_records <- doj_speeches() head(latest_records) # Return a dataframe with 15 of the earliest records. Data is not cleaned. earliest_records <- doj_speeches(n_results = 15, search_direction = "ASC", clean = FALSE) head(earliest_records)