Skip to contents

OTIS b06 – Segregation placements: reason for placement by institution

Usage

morie_datasets_otis_b06_seg_reason_by_institution(
  offline = TRUE,
  resource_id = NULL,
  source = NULL
)

Arguments

offline

If TRUE (default), read the included synthetic fixture. If FALSE, hit Ontario CKAN (resource_id required).

resource_id

Optional CKAN resource id (required for live).

source

One of NULL (default, ships an empty 0-row frame with the documented schema when no real CKAN row is included), "real" (force the real CKAN sample included in inst/extdata/, error if absent), or "synth" (return a deterministic set.seed() synthetic for didactic examples).

Value

A data.frame of the requested dataset (a 0-row typed frame when the data is unavailable offline).

Examples

df <- morie_datasets_otis_b06_seg_reason_by_institution(offline = TRUE)
head(df)
#>   EndFiscalYear Region_AtTimeOfPlacement Institution_AtTimeOfPlacement Gender
#> 1          2022                  Toronto           SYNTH Institution 1   Male
#> 2          2023                  Eastern           SYNTH Institution 2 Female
#> 3          2023                  Central           SYNTH Institution 3   Male
#> 4          2024                  Western           SYNTH Institution 4 Female
#> 5          2024                 Northern           SYNTH Institution 5   Male
#>                    Reason Number_SegregationPlacements
#> 1 Security of Institution                           35
#> 2 Inmate Needs Protection                           12
#> 3            Disciplinary                            8
#> 4   Inmate Refused Search                            4
#> 5         Medical Reasons                            6