Skip to contents

Describes the morie CPADS contract: the canonical analysis variables expected in a wrangled frame, the raw -> canonical column map, and the conventional on-disk cache path used when a user has wrangled the PUMF themselves.

Usage

morie_cpads_contract()

Value

A named list with fields source_kind, expected_wrangled_path, required_variables, raw_column_map, and note.

Details

CPADS is open data (Open Government Licence – Canada). The Public Use Microdata File is available at open.canada.ca, dataset 736fa9b2-62e4-4e31-aea4-51869605b363 (resource d2639429-c304-45a6-90b3-770562f4d46d, file cpads-2021-2022-pumf2.csv). Aggregate dashboards at https://health-infobase.canada.ca/substance-use/reports/cpads/. morie ships a 30-row synthetic at inst/extdata/cpads_pumf_synthetic.csv for offline CRAN-safe tests; morie_datasets_cpads(offline = FALSE) fetches the live PUMF. Earlier morie versions wrongly claimed CPADS was "FOI/agreement-only"; that was incorrect and has been retracted as of 3MMM.

Examples

contract <- morie_cpads_contract()
contract$required_variables
#>  [1] "weight"             "alcohol_past12m"    "heavy_drinking_30d"
#>  [4] "ebac_tot"           "ebac_legal"         "cannabis_any_use"  
#>  [7] "age_group"          "gender"             "province_region"   
#> [10] "mental_health"      "physical_health"