These functions read the CRF_export.xlsx and formats the data for use in R, in particular, variables of class date, datetime, factor, and numeric.
Strategy for labeling factor variables and setting variable classes
Read all 'CRF_export.xlsx' file sheets and construct the structures to produce an Rdata file with (1) variable question labels, (2) correct factor levels with labels, and (3) correct data and numeric data types.
Data in 'Study results' has labels in 'Study variable list'
Data in other data sheets (between 'Study results' and 'Study variable list') has labels in 'Report variable list'
All factor groups with labels and levels are in 'Field options'
Collect Option group names, levels, and labels
'Field options' gives the factor variable levels and labels
'Option group name'
'Option name' labels list with 'Option value' list
Assign variable question labels, Factor variables with Option groups, assign varible class data types
'Study variable list' gives the question names for 'Study results'
'Report variable list' gives the question names for other data sheets (between 'Study results' and 'Study variable list')
'Field label' is the question name
Use 'library(labelled)' with 'var_label()'
For each variable, label it.
1.Use 'factor()' for each variable using 'Option group name' labels and levels
'Field type' variable data class, useful for date, datetime, and numeric.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.