Description Usage Arguments Details Examples
summarize_offender() is a function that queries offender demographic information from FBI Crime API and returns a data frame. You can specify offense type, aggregation level (national, agencies, regions, or states), and aggregation variable (age, ethnicity, etc.) in this function.
1 2 3 4 5 6 | summarize_offender(
offense,
level = "national",
level_detail = NULL,
variable = "count"
)
|
offense |
a string or a list, the offense type(s) to request. Required. |
level |
a string, the level of aggregation. It can be |
level_detail |
a string or a list. Use this parameter to indicate what are the agencies/regions/states you want to query.
For example, when |
variable |
a string, the rule for aggregating. It can be |
Before calling any querying functions, you should pass your API KEY with set_fbi_crime_api_key()
.
1 2 3 4 | summarize_offender(offense = 'burglary')
summarize_offender(offense = 'aggravated-assault', level = 'agencies', level_detail = 'MA0010100', variable = 'age')
summarize_offender(offense = c('burglary','arson'), level = 'regions', level_detail = c('Northeast','South'), variable = 'sex')
summarize_offender(offense = 'arson', level = 'states', level_detail = 'NH', variable = 'race')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.