You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote this for a internal project to identify last-update events for fields and thus forms. I thought it woudl be complicated, but it was not that bad. This is the code that located every field update record for a single REDCap project, PID 2633. It has these features:
Reads directly from the databse backend.
Reads redcap_projects to locate the log table
Writes all the data to an RDS for easy reloading by RScript coders
Separates and pivots the data in the overloaded data_values filed to make that data tidy
Summarizes the data into the last-updated data fior each REDCap field name
I feel like this code has a lot of value, but I am not yet sure what to do with it. There is value in knowing that it can be done and that the that the wall-time required to do it is modest even on very large dataset. There is value in the code that gets the raw data out of REDCap. There is value in the transformation from raw data to tidy. That transformation uses some more modern tidyr methods--separate_longer_delim and separate_wider_delim-- currently in the experimental lifecycle. They were perfectly suited for the job. Its hard to imagine expressing that trasnfrmaiton more succinctly.
Having said all that, maybe this begs for two functions, get_redcap_data_update_values() and make_redcap_data_update_values_tidy(), and a vignette that shows a developer how to use them. It would have a refactored version of this script in it.
I wrote this for a internal project to identify last-update events for fields and thus forms. I thought it woudl be complicated, but it was not that bad. This is the code that located every field update record for a single REDCap project, PID 2633. It has these features:
data_values
filed to make that data tidyI feel like this code has a lot of value, but I am not yet sure what to do with it. There is value in knowing that it can be done and that the that the wall-time required to do it is modest even on very large dataset. There is value in the code that gets the raw data out of REDCap. There is value in the transformation from raw data to tidy. That transformation uses some more modern tidyr methods--
separate_longer_delim
andseparate_wider_delim
-- currently in the experimental lifecycle. They were perfectly suited for the job. Its hard to imagine expressing that trasnfrmaiton more succinctly.Having said all that, maybe this begs for two functions,
get_redcap_data_update_values()
andmake_redcap_data_update_values_tidy()
, and a vignette that shows a developer how to use them. It would have a refactored version of this script in it.The text was updated successfully, but these errors were encountered: