get_chms_meta: Gets CHMS participant metadata.

View source: R/get-chms-meta.R

get_chms_metaR Documentation

Gets CHMS participant metadata.

Description

This function gets CHMS participant metadata.

Usage

get_chms_meta(
  clinic_file,
  agd_dir,
  clinic_id = "CLINICID",
  site = "SITE",
  age = "CLC_AGE",
  day = "V2_DAY",
  month = "V2_MTH",
  year = "V2_YEAR"
)

Arguments

clinic_file

Required: a length-one character vector representing the full path to the clinic file. Note: a .sas7bdat file is expected.

agd_dir

Required: a character vector representing the full path(s) to the site directory ("full/path/to/data/site").

clinic_id

Required (default: "CLINICID"): a length-one character vector representing the clinic ID vector name in clinic_file.

site

Required (default: "SITE"): a length-one character vector representing the site vector name in clinic_file.

age

Required (default: "CLC_AGE"): a length-one character vector representing the age vector name in clinic_file.

day

Required (default: "V2_DAY"): a length-one character vector representing the day vector name of the MEC visit date in clinic_file.

month

Required (default: "V2_MTH"): a length-one character vector representing the month vector name of the MEC visit date in clinic_file.

year

Required (default: "V2_YEAR"): a length-one character vector representing the year vector name of the MEC visit date in clinic_file.

Value

Returns a tibble with eight vectors (id, age, site, agd_lfe, agd_nml, mec_visit_date, start_date, epoch_length).

Examples


# Create participant meta (statcan users)
meta <- get_chms_meta(
  clinic_file = "path/to/clinic/file.sas7bdat",
  agd_dir = "path/to/agd/files/site",
  clinic_id = "CLINICID",
  site = "SITE",
  age = "CLC_AGE",
  day = "V2_DAY",
  month = "V2_MTH",
  year = "V2_YEAR"
)


chms documentation built on Oct. 17, 2026, 5:07 p.m.