Skip to contents

OTIS c12 – Aggregate durations by region

Usage

morie_datasets_otis_c12_aggregate_durations_by_region(
  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_c12_aggregate_durations_by_region(offline = TRUE)
head(df)
#>   EndFiscalYear Region_MostRecentPlacement Gender Measure
#> 1          2022                    Toronto   Male    Mean
#> 2          2023                    Eastern Female  Median
#> 3          2023                    Central   Male     Max
#> 4          2024                    Western Female    Mean
#> 5          2024                   Northern   Male  Median
#>   TotalAggregatedDays_RestrictiveConfinement TotalAggregatedDays_Segregation
#> 1                                       42.8                            20.5
#> 2                                       28.0                            12.0
#> 3                                      175.0                            88.0
#> 4                                       35.2                            17.1
#> 5                                       24.0                            10.0