rc_format | R Documentation |
Uses REDCap project metadata to format records data.
rc_format(
record_data,
data_dict = getOption("redcap_bundle")$data_dict,
event_data = getOption("redcap_bundle")$event_data,
factor_labels = TRUE,
col_labels = TRUE,
dates = TRUE,
event_labels = TRUE,
strip = FALSE
)
record_data |
Dataframe. Record data export from REDCap |
data_dict |
Dataframe. REDCap project data data_dictionary. By default,
this will be fetched from the REDCap bundle option, as created by |
event_data |
Dataframe. REDCap event data. By default, this will be fetched
from the REDCap bundle option, as created by |
factor_labels |
Logical. Determines whether categorical fields (eg radio, dropdown, checkbox) will be formatted as numeric codes or labels. Note that for checkbox fields, 0 (representing an unchecked box) will be replaced with NA. |
col_labels |
Logical. Determines if the field labels are applied to the dataframe columns. |
dates |
Logical. Determines if date variables are converted to POSIXct format during the download. |
event_labels |
Logical. Determines if event labels are applied to redcap_event_name
column (Default = |
strip |
Logical. If |
This function takes raw REDCap data and adds column labels, converts columns to numeric/character/factor as appropriate, and applies factor and checkbox labels. Formatting details of the returned dataframe can be found via attributes(record_data)$redcap_formatting.
Marcus Lehr
Benjamin Nutter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.