ukc_stop_search: Stop and search

Description Usage Arguments Details Value See Also Examples

Description

Returns details on stops and searches at a given location. The stop and searches returned in the API, like the crimes, are only an approximation of where the actual stop and searches occurred, they are not the exact locations.

Usage

1
2
3
4
5
6
7

Arguments

location

If specified, lat and lng are ignored. Location IDs are available through other methods including ukc_street_crime().

date

The year and month in "YYYY-MM" form. If NULL, latest available month will be returned. Also accepts dates in formats that can be coerced to Date class with as.Date().

...

further arguments passed to httr::GET.

lat

Latitude. Accepts a single value or a vector of values to create a custom polygon.

lng

Longitude. Accepts a single value or a vector of values to create a custom polygon.

poly_df

a dataframe containing the lat/lng pairs which define the boundary of the custom area, or a sf or SpatialPointsDataFrame object. The first and last coordinates need not be the same — they will be joined by a straight line once the request is made. If a dataframe, the lat/lng must be the first two columns, or named "lat" and "lng".

Details

Functions accept one of lat and lng pairs, location IDs or a dataframe containing lat/lng pairs defining the boundary of a custom area.

If specified, lat and lng must be the same length. If only one set of coordinates are given, all recorded stop and searches within a one mile radius are returned. If multiple pairs, all recorded stop and searches within a custom drawn polygon will be returned.

Value

A tibble with details of stop and searches outcomes.

See Also

ukc_stop_search_force()

ukc_stop_search_no_location()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

ukc_stop_search2 <- ukc_stop_search_coord(
  lat = c(52.268, 53.194, 52.130),
  lng = c(0.543, 0.238, 0.478)
)


poly_df_4 <- data.frame(
  lat = c(52.268, 52.794, 52.130, 52.000),
  long = c(0.543, 0.238, 0.478, 0.400)
)

ukc_data_poly_4 <- ukc_stop_search_poly(poly_df = poly_df_4)

## End(Not run)

ukpolice documentation built on Aug. 3, 2020, 5:09 p.m.