RememberToBackupDataOP•

I'm working as a statistical programmer now, and have encountered datasets that:

  1. Come from statistical packages that are not R,
  2. Have data dictionaries in all sorts of formats (Word docs, non-OCRed PDF files, copies of forms that people fill out to enter the data in the first place),
  3. Store data in 'value labels', which R does not really support (R's enumerated type is Factors).

This package lets me build data dictionaries in plain text (tab-separated TSV or TXT files) by copying/pasting out of existing dictionaries and then cleaning it up with regular expressions, and then it applies those dictionaries to a dataframe in a memory-conscious way so that it can work with very large data. It supports:

  1. Converting variables to factors (ordered and unordered)
  2. Adding "label" attributes to columns, which are recognised by RStudio and lots of packages.
  3. Renaming columns according to the dictionary.
2