title: Grouping 2 levels of a factor in R
body: <p>I have a column of data that is a factor with levels A, B and C, I am interested in combining two of these levels into one factor, so it would become A and B, with B = B and C, or maybe a new variable A and D, with D = B and C. I can come up with plenty of ways to do this by looping through the column with if statements, but I feel like there should be a more elegant approach and I was wondering if someone could point me in the right direction.</p>