Skip to contents

Apply label and variable ordering attributes to domains.

Usage

apply_metadata(
  df,
  filename,
  add_adsl = TRUE,
  adsl_filename = "metadata/ADSL.yml"
)

Arguments

df

(data.frame)
Data frame to which metadata is applied.

filename

(yaml)
File containing domain metadata.

add_adsl

(logical)
Should ADSL data be merged to domain.

adsl_filename

(yaml)
File containing ADSL metadata.

Examples

seed <- 1
adsl <- radsl(seed = seed)
adsub <- radsub(adsl, seed = seed)
yaml_path <- file.path(path.package("random.cdisc.data"), "inst", "metadata")
adsl <- random.cdisc.data:::apply_metadata(adsl, file.path(yaml_path, "ADSL.yml"), FALSE)
adsub <- random.cdisc.data:::apply_metadata(
  adsub, file.path(yaml_path, "ADSUB.yml"), TRUE,
  file.path(yaml_path, "ADSL.yml")
)