ctsit / redcap_query_collection

A collection of SQL queries that shine light on your REDCap metadata
Other
2 stars 5 forks source link

get_redcap_repo_data cannot support a varying number of authors across repos #9

Closed ChemiKyle closed 3 years ago

ChemiKyle commented 3 years ago

This prevents redcap_repo_report.Rmd from knitting. Issue is traced to the following block:

https://github.com/ctsit/redcap_query_collection/blob/1e82f3e629e7ffaf2bf93f147c3db8f70ef369f5/R/get_redcap_repo_data.R#L85-L88

 Error: Tibble columns must have compatible sizes.
* Size 2: Existing data.
* Size 6: Column `author`.
ℹ Only values of size one are recycled.
Run `rlang::last_error()` to see where the error occurred.

Inspecting redcap_repo_data after this failure shows it contains 12 tibbles, the 13th entry is auto_populate_fields, for which scrape_redcap_repo throws the error.

https://github.com/ctsit/redcap_query_collection/blob/1e82f3e629e7ffaf2bf93f147c3db8f70ef369f5/R/get_redcap_repo_data.R#L73-L75

Taking a look at the 12 entries which did work, the author column has a character vector with 2 (duplicate) entries.
auto_populate_fields has 6 authors!


If we want to keep the tibble data structure, we could concatenate the author column and unroll it back into a vector when it needs to be processed.