Skip to contents

TPS Major Crime Indicators feed.

Usage

morie_datasets_tps_major_crime(
  year = NULL,
  max_features = NULL,
  include_geometry = FALSE,
  offline = FALSE
)

Arguments

year

Integer or NULL. If set, filter to OCC_YEAR == year server-side.

max_features

Integer or NULL; cap on returned rows.

include_geometry

Logical; include geom_x / geom_y.

offline

Logical; return the included synthetic frame instead of hitting the live ArcGIS endpoint.

Value

A data.frame with the documented TPS schema.

Examples

res <- morie_datasets_tps_major_crime(offline = TRUE, max_features = 5L)
#> Warning: morie_datasets_tps_major_crime(offline=TRUE): using the bundled synthetic tps_major_crime frame. This is a toy dataset with the documented schema but random data; do not interpret outputs as findings about the real population.
head(res)
#>   OBJECTID EVENT_UNIQUE_ID         REPORT_DATE            OCC_DATE REPORT_YEAR
#> 1        1     GO-20240001 2024/01/02 00:00:00 2024/01/01 00:00:00        2024
#> 2        2     GO-20240002 2024/03/10 12:00:00 2024/03/10 11:30:00        2024
#> 3        3     GO-20240003 2024/06/15 22:00:00 2024/06/15 21:45:00        2024
#> 4        4     GO-20240004 2024/09/20 03:00:00 2024/09/20 02:15:00        2024
#> 5        5     GO-20250001 2025/01/05 09:00:00 2025/01/05 08:30:00        2025
#>   REPORT_MONTH REPORT_DAY REPORT_DOY REPORT_DOW REPORT_HOUR OCC_YEAR OCC_MONTH
#> 1            1          2          2    Tuesday           3     2024         1
#> 2            3         10         70     Sunday          12     2024         3
#> 3            6         15        167   Saturday          22     2024         6
#> 4            9         20        264     Friday           3     2024         9
#> 5            1          5          5     Sunday           9     2025         1
#>   OCC_DAY OCC_DOY  OCC_DOW OCC_HOUR DIVISION LOCATION_TYPE
#> 1       1       1   Monday       22      D14     Apartment
#> 2      10      70   Sunday       11      D52    Commercial
#> 3      15     167 Saturday       21      D31       Outdoor
#> 4      20     264   Friday        2      D55       Outdoor
#> 5       5       5   Sunday        8      D14         House
#>                   PREMISES_TYPE UCR_CODE UCR_EXT             OFFENCE
#> 1 Apartment (Rooming House Etc)     1430     200             Assault
#> 2           Commercial (Office)     2110     100     Break and Enter
#> 3                       Outside     1410     210             Robbery
#> 4                     Apartment     1430     200 Assault With Weapon
#> 5         House (Detached/Semi)     2120     300          Auto Theft
#>      MCI_CATEGORY HOOD_158                 NEIGHBOURHOOD_158 HOOD_140
#> 1         Assault       82                           Niagara       82
#> 2 Break and Enter      168               Downtown Yonge East       75
#> 3         Robbery       73                         Moss Park       73
#> 4         Assault       77 Waterfront Communities-The Island       77
#> 5      Auto Theft       82                           Niagara       82
#>                   NEIGHBOURHOOD_140 LONG_WGS84 LAT_WGS84        x       y
#> 1                           Niagara   -79.4029   43.6478 -79.4029 43.6478
#> 2             Church-Yonge Corridor   -79.3793   43.6532 -79.3793 43.6532
#> 3                         Moss Park   -79.3705   43.6555 -79.3705 43.6555
#> 4 Waterfront Communities-The Island   -79.3832   43.6426 -79.3832 43.6426
#> 5                           Niagara   -79.4029   43.6478 -79.4029 43.6478