Converts an IRW-compliant dataset from long format to wide format while handling optional metadata elements, filtering by wave, and ensuring consistency.
Arguments
- df
A data frame containing IRW-compliant item response data in long format.
- wave
(Optional) A numeric value specifying which wave to filter. If the dataset does not have a "wave" column, this input is ignored. Defaults to the most frequent wave if
NULL
.- id_density_threshold
A numeric value between
0.0
and1.0
specifying the minimum response density required for anid
to be included. Default is0.1
. Set toNULL
to disable filtering.- agg_method
A string specifying how to handle multiple
id
-item
pairs. Options:"mean"
(default),"mode"
,"median"
,"first"
.