
Download codebook
download_codebook.RdThis function downloads codebooks from the IQB Studio.
Usage
download_codebook(
workspace,
path,
file_prefix = "",
unit_keys = NULL,
format = c("docx", "json"),
missings_profile = NULL,
only_coded = FALSE,
general_instructions = TRUE,
hide_item_var_relation = TRUE,
derived = TRUE,
manual = TRUE,
closed = TRUE,
show_score = FALSE,
code_label_to_upper = TRUE
)
# S4 method for class 'WorkspaceStudio'
download_codebook(
workspace,
path,
file_prefix = "",
unit_keys = NULL,
format = c("docx", "json"),
missings_profile = NULL,
only_coded = FALSE,
general_instructions = TRUE,
hide_item_var_relation = TRUE,
derived = TRUE,
manual = TRUE,
closed = TRUE,
show_score = FALSE,
code_label_to_upper = TRUE
)Arguments
- workspace
WorkspaceStudio. Workspace information necessary to download codebook via the API.
- path
Character. Path of the directory for the codebook files to be downloaded to. The default filename is determined by the id and the label of the IQB Studio workspace.
- file_prefix
Character (optional). Path prefix, e.g., a date to keep track of different versions of the codebook.
- unit_keys
Character. Exact, case-sensitive unit keys (short names) returned by
list_units(), not numeric IDs or labels. UseNULL(default) for all units. An empty vector or unknown keys raise an error before export.- format
Character. Either
"docx"(default) or"json".- missings_profile
Character (optional). Exact, case-sensitive label of a missing-value profile configured in Studio. With
NULL(default), no profile is selected. An unknown label raises an error before downloading.- only_coded
Logical. Should only variables with codes be shown?
- general_instructions
Logical. Should the general coding instructions be printed? Defaults to
TRUE.- hide_item_var_relation
Logocal. Should item-variable relations be printed? Defaults to
FALSE.- derived
Logical. Should the derived variables be printed? Defaults to
TRUE.- manual
Logical. Should only items with manual coding be printed? Defaults to
TRUE.- closed
Logical. Should items that could be automatically coded be printed? Defaults to
TRUE.- show_score
Logical. Should the score be printed? Defaults to
FALSE.- code_label_to_upper
Logical. Should the code labels be printed in capital letters? Defaults to
TRUE.
Details
Unit keys are checked across all selected workspaces before exporting. If no units are available, the function raises an error. A failed download stops further exports and retains the original API error.
Missing-value profiles are configured in Studio. Use the exact profile label
shown in Studio's codebook export dialog. A selected profile is checked via
admin/settings/missings-profiles using the workspace's login before export.
Its missing-value codes are included in the downloaded JSON or DOCX file.
With missings_profile = NULL, no profile lookup is performed.