I have data similar to this in R:
subjID = c(1,2,3,4) var1 = c(3,8,NA,6) var1.copy = c(NA,NA,5,NA) fake = data.frame(subjID = subjID, var1 = var1, var1 = var1.copy)
which is as follows:
> fake subjID var1 var1.1 1 1 3 NA 2 2 8 NA 3 3 NA 5 4 4 6 NA
Var1 and Var1.1 represent the same variable, so each object has an NA for one column and a numerical value in the other (who does not have two NA or two numbers). I want to combine the columns to get one Var1: (3, 8, 5, 6).
Any tips on how to do this?
source share