Description Usage Arguments Note Examples
Extract crime areas within a polygon
1 | ukp_crime_poly(poly_df, date = NULL, ...)
|
poly_df |
dataframe containing the lat/lng pairs which define the
boundary of the custom area. If a custom area contains more than 10,000
crimes, the API will return a 503 status code. ukp_crime_poly converts the
dataframe into lat/lng pairs, separated by colons:
|
date, |
Optional. (YYY-MM), limit results to a specific month. The latest month will be shown by default. e.g. date = "2013-01" |
... |
further arguments passed to or from other methods. For example,
verbose option can be added with
|
further documentation here: https://data.police.uk/docs/method/crime-street/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ukpolice)
# with 3 points
poly_df_3 = data.frame(lat = c(52.268, 52.794, 52.130),
long = c(0.543, 0.238, 0.478))
ukp_data_poly_3 <- ukp_crime_poly(poly_df_3)
head(ukp_data_poly_3)
# with 4 points
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))
ukp_data_poly_4 <- ukp_crime_poly(poly_df = poly_df_4)
head(ukp_data_poly_4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.