I am trying to merge two columns in my dataset based on binary survey responses (Yes/No). The dataset looks like this: Treatment1: "No", N/A, N/A, "Yes", "No", N/A, "No" ... Treatment2: N/A, "Yes", "No", N/A, N/A, "No", N/A ...
The scores are thus corresponding to each other based on the treatment group of each respondent. Now, I am trying to create a new variable that merges these values into one single variable: "No", "Yes", "No" ... so that the N/A's are substituted by the answers from the other Treatment.
I tried using coalesce() but the resulting variable only has the values from Treatment1, it somehow doesn't merge them. I can't find the reason why! Perhaps someone can help - I am new to R!
Thanks!