Get information about the selected agency including the 9-digit ORI, geographic information, type of agency, and whether they report to NIBRS.

get_agency_info(agency, state = NULL, ori_only = FALSE, exact_match = TRUE)

Arguments

agency

A string or vector of strings with the name of the agency you want to lookup (capitalized is ignored).

state

A string or vector of strings of state names. If used, returns only agencies in that state. This is useful in cases where multiple agencies have the same name in different states and you only want specific states.

ori_only

If TRUE (not default), returns only the ORI and the agency_name columns.

exact_match

If TRUE (default), finds matches based on exact match of agency name. Else, uses `grep()` to find agencies with similar names to inputted agency.

Value

A data.frame with information about the agency - including ORI code and geographic information. The agency will have as many rows as agencies matched from the `agency` input.

Examples

get_agency_info("Oakland Police Department")
#> ori agency_name agency_type_name state_name #> 905 CA0010900 Oakland Police Department City California #> 2506 FL0480800 Oakland Police Department City Florida #> 6607 MD0120200 Oakland Police Department City Maryland #> 6761 ME0060500 Oakland Police Department City Maine #> 8433 MO0959700 Oakland Police Department City Missouri #> 10049 NJ0024200 Oakland Police Department City New Jersey #> 14116 PA0580500 Oakland Police Department City Pennsylvania #> 15139 TN0240500 Oakland Police Department City Tennessee #> state_abbr division_name region_name region_desc county_name nibrs #> 905 CA Pacific West Region IV ALAMEDA FALSE #> 2506 FL South Atlantic South Region III ORANGE FALSE #> 6607 MD South Atlantic South Region III GARRETT FALSE #> 6761 ME New England Northeast Region I KENNEBEC TRUE #> 8433 MO West North Central Midwest Region II ST LOUIS FALSE #> 10049 NJ Middle Atlantic Northeast Region I BERGEN FALSE #> 14116 PA Middle Atlantic Northeast Region I SUSQUEHANNA FALSE #> 15139 TN East South Central South Region III FAYETTE TRUE #> latitude longitude nibrs_start_date #> 905 37.79965 -122.27459 NULL #> 2506 28.514435 -81.323295 NULL #> 6607 39.410545 -79.405556 NULL #> 6761 44.417012 -69.765764 12/01/2011 #> 8433 38.602047 -90.35826 NULL #> 10049 40.959648 -74.07486 NULL #> 14116 41.95525 -75.60348 NULL #> 15139 35.196993 -89.413803 07/01/1999
get_agency_info("Oakland Police Department", state = "california")
#> ori agency_name agency_type_name state_name state_abbr #> 905 CA0010900 Oakland Police Department City California CA #> division_name region_name region_desc county_name nibrs latitude longitude #> 905 Pacific West Region IV ALAMEDA FALSE 37.79965 -122.27459 #> nibrs_start_date #> 905 NULL