View source: R/REDCap_labels.R
| REDCap_col_labels | R Documentation |
Sets the label attribute on matching columns in data.
REDCap_col_labels(
data,
lookup,
var_col = `Variable / Field Name`,
label_col = `Field Label`,
warn = TRUE
)
data |
A data frame. |
lookup |
A data frame with variable names and labels. |
var_col |
Unquoted column in |
label_col |
Unquoted column in |
warn |
Logical; warn when labels are provided for variables not present
in |
data with label attributes added.
dict_path <- system.file("ext", "DataDictionary_chronotype.csv",
package = "melidosData"
)
dict <- utils::read.csv(dict_path, check.names = FALSE)
dict <- REDCap_codebook_prepare(dict, form.filter = "mctq")
labelled <- REDCap_col_labels(REDCap_example_chronotype, dict)
attr(labelled[[5]], "label")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.