
Last chance! 50% off unlimited learning
Sale ends in
This method enables the user to construct a code book similar in style to the REDCap project codebook. The codebook is similar in nature to the data dictionary, but multiple choice fields are represented with one line per coding.
assembleCodebook(
rcon,
fields = NULL,
forms = NULL,
drop_fields = NULL,
field_types = NULL,
include_form_complete = TRUE,
expand_check = FALSE,
...
)# S3 method for redcapConnection
assembleCodebook(
rcon,
fields = NULL,
forms = NULL,
drop_fields = NULL,
field_types = NULL,
include_form_complete = TRUE,
expand_check = FALSE,
...
)
# S3 method for redcapCodebook
as.list(x, ...)
Returns a redcapCodebook
object. This inherits the data.frame
class
and has the columns
field_name
- The name of the field.
form
- The name of the form on which the field is located.
field_type
- The field type.
code
- For multiple choice fields, the coding for the option.
label
- For multiple choice fields, the label for the option.
min
- For date and numeric fields, the minimum value in the validation, if any.
max
- For date and numeric fields, the maximum value in the validation, if any.
branching_logic
- For fields with branching logic, the string denoting the logic applied.
field_order
- The numeric order of the field in the data dictionary.
form_order
- The numeric order of the form in the data dictionary.
A redcapConnection
object.
character
or NULL
. When character
, the code book will
be limited to the intersection of the fields designated by fields
and forms
. When NULL
, all fields are included.
character
or NULL
. When character
, the code book will
be limited to the intersection of the fields designated by fields
and forms
. When NULL
, all forms are included.
character
or NULL
. When given, fields named
will be removed from the code book.
character
or NULL
. When given, only the field
types listed will be included in the code book. This will supercede
the intersection of fields
and forms
. Matching of field types is
performed against the values in the field_type
column of the meta data.
logical(1)
. When TRUE
, the
[form name]_complete
fields will be included in the codebook.
logical(1)
. When FALSE
, the codebook for checkbox
fields will be similar to the codebook for dropdown and radio fields,
with one line per user-defined option. When TRUE
, each checkbox option
will be represented in two fields, one each for 0 (Unchecked) and
1 (Checked).
Arguments to pass to other methods
A redcapCodebook
object as returned by assembleCodebook
.
exportMetaData()
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
# codebook for the entire project
assembleCodebook(rcon)
# codebook for multiple choice fields
assembleCodebook(rcon,
field_types = c("dropdown", "radio", "checkbox",
"yesno", "truefalse"))
}
Run the code above in your browser using DataLab