Nuts and Bolts: Squishing columns together to get rid of NAs in R

450px-Plastic-_and_Nylonzipper

Zipper picture from Wikimedia Commons, by Rabensteiner – Bearbeitet von Rainer Z

I found my self in a bit of a quandry. I had a data frame which contained many columns that needed to be squished together – each contained a few values, but mostly NAs, and none of the values were overlapping. They represented the same variable, but broken apart across several columns. I needed to condense several columns into one.

Continue reading