Skip to contents

TPS PSDP – Break and Enter

Usage

morie_datasets_tps_breakandenter(
  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_breakandenter(max_features = 5L))
if (!inherits(df, "try-error")) head(df)
#>   OBJECTID      EVENT_UNIQUE_ID         REPORT_DATE            OCC_DATE
#> 1        1 GO-PSDP-SYNTH-BE-001 2024/01/05 09:00:00 2024/01/05 02:00:00
#> 2        2 GO-PSDP-SYNTH-BE-002 2024/04/12 14:00:00 2024/04/12 03:00:00
#> 3        3 GO-PSDP-SYNTH-BE-003 2024/08/18 11:00:00 2024/08/18 04:00:00
#> 4        4 GO-PSDP-SYNTH-BE-004 2025/02/22 16:00:00 2025/02/22 05:30:00
#> 5        5 GO-PSDP-SYNTH-BE-005 2025/05/01 08:00:00 2025/04/30 23:00:00
#>   REPORT_YEAR REPORT_MONTH REPORT_DAY REPORT_DOY REPORT_DOW REPORT_HOUR
#> 1        2024            1          5          5     Friday           9
#> 2        2024            4         12        103     Friday          14
#> 3        2024            8         18        231     Sunday          11
#> 4        2025            2         22         53   Saturday          16
#> 5        2025            5          1        121   Thursday           8
#>   OCC_YEAR OCC_MONTH OCC_DAY OCC_DOY   OCC_DOW OCC_HOUR DIVISION LOCATION_TYPE
#> 1     2024         1       5       5    Friday        2      D52    Commercial
#> 2     2024         4      12     103    Friday        3      D14         House
#> 3     2024         8      18     231    Sunday        4      D31     Apartment
#> 4     2025         2      22      53  Saturday        5      D55         House
#> 5     2025         4      30     120 Wednesday       23      D14    Commercial
#>         PREMISES_TYPE UCR_CODE UCR_EXT         OFFENCE    CSI_CATEGORY HOOD_158
#> 1 Commercial (Office)     2110     100 Break and Enter Break and Enter      168
#> 2               House     2110     200 Break and Enter Break and Enter       82
#> 3           Apartment     2110     100 Break and Enter Break and Enter       73
#> 4               House     2110     200 Break and Enter Break and Enter        1
#> 5              Retail     2110     100 Break and Enter Break and Enter      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
# }