DesiQuintans / tsv2label

tsv2label: Label, describe, rename, and recode datasets using a data dictionary
Other
2 stars 0 forks source link

Add a recoding column to factor files? #8

Closed DesiQuintans closed 1 year ago

DesiQuintans commented 1 year ago

I was editing a factor file one day (Standard Australian Classification of Countries 2016) to turn country codes into major region codes, and I disliked how this involved me replacing the country labels entirely with major region labels. It seems to me that a more maintainable and transparent solution is to preserve the original labels alongside their replacements. Maybe add a new column (recode?) that, rowwise, is preferentially used over the labels column?

DesiQuintans commented 1 year ago

Actually, what I should do is leave the package alone and instead leverage tsv2label's "ignore columns that I don't know about" approach; the user is free to make any other column they want. In this instance, I could have saved the original country codes in a different column while still renaming labels to merge the country codes into major regions.