Skip to contents

TPS PSDP – Intimate Partner and Family Violence

Usage

morie_datasets_tps_intimate_partner_family_violence(
  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

df <- morie_datasets_tps_intimate_partner_family_violence(offline = TRUE)
head(df[, c("INDEX", "FAMILY_VIOLENCE_FLAG",
            "FAMILY_VIOLENCE_RELATION", "COUNT")])
#>            INDEX FAMILY_VIOLENCE_FLAG FAMILY_VIOLENCE_RELATION COUNT
#> 1 IPFV-SYNTH-001                  Yes                   Spouse     3
#> 2 IPFV-SYNTH-002                   No                              1
#> 3 IPFV-SYNTH-003                  Yes                    Child     2
#> 4 IPFV-SYNTH-004                  Yes                   Parent     1
#> 5 IPFV-SYNTH-005                   No                              1