Checks if all codelists required by a dataset are in cache. Downloads missing codelists before labeling operations. This prevents apply_labels() from failing on new datasets.
Usage
ensure_codelists(dataset_id, cache_dir = .istatlab_cache_dir(), verbose = TRUE)Examples
if (FALSE) { # \dontrun{
# Ensure codelists before labeling
if (ensure_codelists("534_50")) {
labeled_data <- apply_labels(raw_data)
}
# Check new dataset
ensure_codelists("150_908", verbose = TRUE)
} # }