I asked a question about this a few months back, and I thought the answer had solved my problem, but I ran into the problem again and the solution didn\'t work for me.
I just came across this problem and it was for a simple reason. I had labels that began with a number, and R was adding an X in front of them all. I think R is confused with a number in the header and applies a letter to differentiate from values.
So, "3_in" became "X3_in" etc... I solved by switching the label to "in_3" and the issues was resolved.
I hope this helps someone.