Skip to contents

TPS PSDP – Theft Over

Usage

morie_datasets_tps_theft_over(
  year = NULL,
  max_features = NULL,
  offline = TRUE,
  layer_url = NULL
)

Arguments

year

Optional reporting year filter (applies an OCC_YEAR = <year> WHERE clause when offline = FALSE).

max_features

Optional cap on returned rows (offline = FALSE only).

offline

If TRUE (default), read the included synthetic fixture from inst/extdata/tps_mha_apprehensions_sample.csv (5 rows in the canonical TPS PSDP 22-column schema). If FALSE, hit the TPS PSDP ArcGIS FeatureServer.

layer_url

Optional ArcGIS layer URL override.

Value

A data.frame.

Examples

# \donttest{
df <- try(morie_datasets_tps_theft_over(max_features = 5L))
if (!inherits(df, "try-error")) head(df)
#>   OBJECTID      EVENT_UNIQUE_ID         REPORT_DATE            OCC_DATE
#> 1        1 GO-PSDP-SYNTH-TO-001 2024/02/10 11:00:00 2024/02/10 10:30:00
#> 2        2 GO-PSDP-SYNTH-TO-002 2024/06/05 14:00:00 2024/06/05 13:00:00
#> 3        3 GO-PSDP-SYNTH-TO-003 2024/11/22 16:00:00 2024/11/22 15:30:00
#> 4        4 GO-PSDP-SYNTH-TO-004 2025/03/18 09:00:00 2025/03/18 08:30:00
#> 5        5 GO-PSDP-SYNTH-TO-005 2025/05/22 12:00:00 2025/05/22 11:30:00
#>   REPORT_YEAR REPORT_MONTH REPORT_DAY REPORT_DOY REPORT_DOW REPORT_HOUR
#> 1        2024            2         10         41   Saturday          11
#> 2        2024            6          5        157  Wednesday          14
#> 3        2024           11         22        327     Friday          16
#> 4        2025            3         18         77    Tuesday           9
#> 5        2025            5         22        142   Thursday          12
#>   OCC_YEAR OCC_MONTH OCC_DAY OCC_DOY   OCC_DOW OCC_HOUR DIVISION LOCATION_TYPE
#> 1     2024         2      10      41  Saturday       10      D52    Commercial
#> 2     2024         6       5     157 Wednesday       13      D14     Apartment
#> 3     2024        11      22     327    Friday       15      D31       Streets
#> 4     2025         3      18      77   Tuesday        8      D55    Commercial
#> 5     2025         5      22     142  Thursday       11      D14    Commercial
#>   PREMISES_TYPE UCR_CODE UCR_EXT    OFFENCE CSI_CATEGORY HOOD_158
#> 1        Retail     2120     100 Theft Over   Theft Over      168
#> 2     Apartment     2120     100 Theft Over   Theft Over       82
#> 3       Outside     2120     100 Theft Over   Theft Over       73
#> 4        Retail     2120     100 Theft Over   Theft Over        1
#> 5        Retail     2120     100 Theft Over   Theft Over      163
#>           NEIGHBOURHOOD_158 HOOD_140          NEIGHBOURHOOD_140 LONG_WGS84
#> 1       Downtown Yonge East       75 Church-Yonge Corridor (75)   -79.3793
#> 2                   Niagara       82               Niagara (82)   -79.4029
#> 3                 Moss Park       73             Moss Park (73)   -79.3705
#> 4    West Humber-Clairville        1 West Humber-Clairville (1)   -79.5800
#> 5 Fort York-Liberty Village       82               Niagara (82)   -79.3832
#>   LAT_WGS84        x       y
#> 1   43.6532 -79.3793 43.6532
#> 2   43.6478 -79.4029 43.6478
#> 3   43.6555 -79.3705 43.6555
#> 4   43.7400 -79.5800 43.7400
#> 5   43.6426 -79.3832 43.6426
# }