meta_factors | R Documentation |
Converts field options and labels from the metadata dictionary (see
meta_dictionary
), which has 1 row per variable and field options in
compact string-form, to long form with 1 row per option. E.g.:
Dictionary version (1 row per variable):
field_name | form_name | field_type | choices |
consented | enrollment | radio | 0, No | 1, Yes |
Long format (1 row per option):
field_name | form_name | field_type | value | label |
consented | enrollment | radio | 0 | No |
consented | enrollment | radio | 1 | Yes |
meta_factors(
conn,
forms = NULL,
expand_checkbox = TRUE,
add_complete = FALSE,
types = c("radio", "yesno", "dropdown", "checkbox")
)
conn |
A REDCap API connection object (created with |
forms |
Character vector of forms (i.e. instruments) to include. Set to
|
expand_checkbox |
Logical indicating whether to expand checkbox
variables. Defaults to Unlike an "Export Records" API request (see When |
add_complete |
Logical indicating whether to add "{form}_complete"
fields to the dictionary, one for each form included in the return. These
will be of field_type "radio" with possible choices "0, Incomplete | 1,
Unverified | 2, Complete". Defaults to |
types |
Character vector of variable types to return field options for.
|
A tibble
-style data frame with 6 columns:
field_name
form_name
field_type
field_label
value
label
meta_dictionary
## Not run:
conn <- rconn(
url = "https://redcap.msf.fr/api/",
token = Sys.getenv("MY_REDCAP_TOKEN")
)
meta_factors(conn)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.