ukpolice is an R package that facilitates retrieving data from the UK police database.. The data provided by the API contains public sector information licensed under the Open Government Licence v3.0.

Get the crime data with ukp_crime

ukp_crime() draws crimes from within a one mile radius of the location.

When no date is specified, it uses the latest month available, which can be found using ukp_last_update().

Example usage

Use leaflet

You can add a popup that displays the crime type using the popup argument in leaflet.

Neighbourhood information

ukp_neighbourhood(), retrieves a list of neighbourhoods for a force, https://data.police.uk/docs/method/neighbourhoods/

This returns a tibble with columns id and name.

  • id is a Police force specific team identifier, (note that this identifier is not unique and may also be used by a different force).
  • name is the name for the neighbourhood.