OuhscBbmc / REDCapR

R utilities for interacting with REDCap
https://ouhscbbmc.github.io/REDCapR
Other
112 stars 46 forks source link

deprecate the `*_collapsed` parameters #440

Closed wibeasley closed 1 year ago

wibeasley commented 1 year ago

Does anyone use the following parameters? I don't think so, and they're making it a little more complicated to monitor & augment functions --such as including additional & required plumbing variables (#439).

For instance in redcap_read(), the parameters are

  records_collapsed   <- collapse_vector(records  , records_collapsed)
  fields_collapsed    <- collapse_vector(fields   , fields_collapsed)
  forms_collapsed     <- collapse_vector(forms    , forms_collapsed)
  events_collapsed    <- collapse_vector(events   , events_collapsed)

When people want to limit on records/fields/forms/events, they usually pass in the vector of characters, not the scalar character separated by commas. In other words c("demographics", "blood_pressure") instead of "demographics,blood_pressure"

If some is using the *_collapsed parameter, they can programmatically convert it to a vector like:

field_names <- trimws(unlist(strsplit(field_names_collapsed, ",")))