View source: R/prep_add_cause_label_df.R
prep_add_cause_label_df | R Documentation |
The function has to working modes. If replace_meta_data
is TRUE
, by
default, if cause_label_df
contains a column
named resp_vars
, then the missing/jump codes in
meta_data[, c(MISSING_CODES, JUMP_CODES)]
will be overwritten, otherwise,
it will be labeled using the cause_label_df
.
prep_add_cause_label_df(
meta_data = "item_level",
cause_label_df,
label_col = VAR_NAMES,
assume_consistent_codes = TRUE,
replace_meta_data = ("resp_vars" %in% colnames(cause_label_df))
)
meta_data |
data.frame the data frame that contains metadata attributes of study data. |
cause_label_df |
data.frame missing code table. If missing codes have labels the respective data frame can be specified here, see cause_label_df |
label_col |
variable attribute the name of the column in the metadata with labels of variables |
assume_consistent_codes |
logical if TRUE and no labels are given and the same missing/jump code is used for more than one variable, the labels assigned for this code will be the same for all variables. |
replace_meta_data |
logical if |
If a column resp_vars
exists, then rows with a value in resp_vars
will
only be used for the corresponding variable.
data.frame updated metadata including all the code labels in missing/jump lists
prep_extract_cause_label_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.