Extract an Instrument from an REDCap Export
This function takes a data frame and the names of the first and last variables in an instrumnt and returns a data frame with the instrument.
make_instrument( df, first_var, last_var, drop_which_when = FALSE, record_id = "record_id" )
df
: A data frame with the instrumentfirst_var
: The name of the first variable in an instrumentlast_var
: The name of the last variable in an instrumentdrop_which_when
: Drop the record_id
and redcap_event_name
variablesrecord_id
: Name of record_id
variable (if it was changed in REDCap)A data frame that has an instrument (with at least one not NA value)
Useful links