Inverse of irw_recode(): maps codes such as I0001 back to the
original identifier values using the recode key.
Arguments
- x
A data frame returned by
irw_recode(), or derived from one (including the wide result ofirw_long2resp()).- key
A recode key as returned by
irw_recode_key(). Defaults to the key attached tox; supply it explicitly if the attribute was dropped.- cols
Character vector of columns to decode. Defaults to all columns present in both
xand the key.
Details
Works on long-format data (columns named in the key are decoded in place) and
on the wide output of irw_long2resp(), where item codes appear as
column names. An item_ prefix on a column name is handled and
preserved, which since #3221 matters only for a matrix built by an older
version of this package – irw_long2resp() now returns the item ids
themselves. Values or column names that are not found in the key are left
untouched.