Deterministic counterpart to crunch_ai_names(). Instead of generating
display names with an LLM, it fills the dictionary name column from the
analyst-authored alias_name values captured in the project's Crunch
metadata (see crunch_set_metadata()). Aliases without an alias_name keep
their original Crunch name, so the result is always safe to pass to
crunch_apply_dictionary().
Usage
crunch_alias_names(crunch_dictionary, project = g6tr.dl::dl_get_project())Arguments
- crunch_dictionary
A Crunch dictionary tibble (see
crunch_get_dictionary()). Must containaliasandname.- project
Project name or ID. Defaults to
g6tr.dl::dl_get_project().
Value
The dictionary with name set from alias_name (falling back to the
original name) and the original name preserved in name_original.
Details
Use whichever path fits the project: crunch_alias_names() when the survey
already carries good display names, or crunch_ai_names() to generate them.
Both return the same shape (a name column plus name_original), so they
are interchangeable in the dictionary flow — and can be chained, using
crunch_alias_names() first and crunch_ai_names() only for the gaps.
Examples
if (FALSE) { # \dontrun{
crunch_ds <- crunch_connect()
crunch_dictionary <- crunch_get_dictionary(crunch_ds)
crunch_dictionary <- crunch_alias_names(crunch_dictionary)
crunch_apply_dictionary(crunch_ds, crunch_dictionary)
} # }