Ipumsr and swap files

If I assign the values in the comma-delimited 1976-2010 swap values file from here: https://cps.ipums.org/cps/income_cell_means.shtml, (bottom of the page), to the corresponding variables as provided and transformed through ipumsr, will these variables still be formatted correctly for these years and values?

I’m sorry, I don’t think I understand your question.

What formatting are you asking about? What functions are you using to transform the data and assign values?

Some R functions are known to lose things like the value and variable labels, there is some discussion about this in the value labels vignette.

The formatting I am referring to is not anything that I do – it is things like the vector having the labeled class with the labels attached, and the right number of implicit digits. The swap values only exist for some YEAR/SERIAL number/variable combinations, so I have to merge them based on the year and serial and which of the sometimes-swapped variables have non-zero values in the row specified by year and serial.

Actually I think each row in the swap value table provides only a single swap value – odd for a rectangular table. Why all the extra zeros? So there are multiple rows for any YEAR/SERIAL combination that has a swap value for more than one variable.

I haven’t written any code yet. Now I think I will do it by column rather than be row. My thought is to drop all the zeros, snip the “_swap” off the variable name, and assign the remaining rows by YEAR & SERIAL. I think there should never be more than one once the rows with zeros for a given variable are removed.