Additional options for codebook creation
Source:R/cb_create.r, R/cb_create_redcap.r
cb_create_options.RdAdditional options for use by cb_create().
Usage
cb_create_options(
...,
include_types = TRUE,
include_r_classes = FALSE,
rmv_html = TRUE,
rmv_line_breaks = TRUE,
user_missing_col = c("if_any", "yes", "no"),
user_missing_conflict = c("val_label", "missing_label"),
user_missing_incompatible = c("ignore", "warn", "error")
)
cb_create_redcap_options(
...,
include_types = TRUE,
include_r_classes = FALSE,
rmv_html = TRUE,
rmv_line_breaks = TRUE,
user_missing_col = c("if_any", "yes", "no"),
user_missing_conflict = c("val_label", "missing_label"),
user_missing_incompatible = c("ignore", "warn", "error"),
name = field_name,
var_label = field_label,
val_labels = select_choices_or_calculations,
type = field_type,
form = form_name,
val_labs_sep1 = ", ",
val_labs_sep2 = "\\|",
coerce_integers = TRUE,
checkbox_resp_values = FALSE,
propagate_checkbox_missings = TRUE
)Arguments
- ...
These dots are for future extensions and must be empty.
- include_types
Include a column listing simplified type for each variable? (e.g,.
"categorical","date-time".)- include_r_classes
Include a column listing class(es) of each variable? (e.g.,
"factor","POSIXct, POSIXt".)- rmv_html
Should HTML tags be removed from metadata (e.g., from variable and value labels)?
- rmv_line_breaks
Should line breaks be removed from metadata (e.g., from variable and value labels)? If
TRUE, line breaks will be replaced with" / ".- user_missing_col
Include value labels for user missing values in a separate column? The default,
"if_any", adds the column only if user missings are specified for at least one variable.- user_missing_conflict
If labels passed to
.user_missingconflict with value labels in metadata, which should be used?- user_missing_incompatible
How to handle variables specified in
.user_missingthat aren't compatible with user missing values (e.g., logical, Date, or POSIXt)?- name, var_label, val_labels, type
For REDCap data, columns in
metadatacontaining variable name, variable label, value labels, and variable type, respectively.- form
For REDCap data, column in
metadatacontaining form names. (Set toNULLto omit.)- val_labs_sep1, val_labs_sep2
For REDCap data, regex patterns separating value labels in
metadata.val_labs_sep1separates values from labels, andval_labs_sep2separates value/label pairs from one another. e.g., if value labels are in the format"1, First label|2, Second label", setval_labs_sep1to","andval_labs_sep2to"\\|".- coerce_integers
For REDCap data, should variables listed as "integer" in
metedata$text_validation_type_or_show_slider_numberbe coerced to integer?- checkbox_resp_values
For REDCap data, should checkbox values use labels in
metadata(TRUE) or "Yes" / "No" (FALSE)? See "Checkbox data handling" on thecb_create_redcap()help page.- propagate_checkbox_missings
For REDCap data, should user missing values in a checkbox group be propagated across all variables in the group? See "Checkbox data handling" on the
cb_create_redcap()help page.