if (FALSE) {
library(redquack)
library(dplyr)
conn <- use_duckdb()
result <- redcap_to_db(
conn,
url = "https://bbmc.ouhsc.edu/redcap/api/",
token = "9A81268476645C4E5F03428B8AC3AA7B"
)
# Convert table to a list of instruments
instruments <- tbl_redcap(conn) |>
collect_list()
# Control labeling behavior
instruments_no_val_labels <- tbl_redcap(conn) |>
collect_list(cols = FALSE)
# Convert coded values to text labels
instruments_with_codes <- tbl_redcap(conn) |>
collect_list(convert = TRUE)
# Works with filtered data
filtered_instruments <- tbl_redcap(conn) |>
filter(name_last == "Nutmouse") |>
collect_list()
remove_duckdb(conn)
}
Run the code above in your browser using DataLab