redcapFactorFlip function

Convert REDCap factors between labeled and coded

Convert REDCap factors between labeled and coded

Factors exported from REDCap can be toggled between the coded and labeled values with the use of the attributes assigned to the factors during export.

redcapFactorFlip(v)

Arguments

  • v: A factor exported from REDCap. The REDCap type may be radio, dropdown, check, yesno, etc.

Details

Each factor type variable in REDCap is given the attributes redcapLabels and redcapLevels. With these attached to the vector, switching between the coded and labeled values can be done with ease. This may be helpful when the coded value has importance, such as 0/1 for death, or if a yes is worth six points (instead of one).

  • Maintainer: Shawn Garbett
  • License: GPL-2
  • Last published: 2024-10-17