I am trying to merge two datasets like so
V1
Berry
as the first data set and
V4 V6 V7 V1
Temp Temp Temp Temp
To make
V4 V6 V7 V1
Temp Temp Temp Temp
NA NA NA Berry
I have tried using
test2<-merge(Session1t, temp2, by=temp1, all = TRUE)
Where temp1 is the column name V1 stored as a value. The problem I am having is I cannot explicitly state by="V1", because this is inside of a loop where the column names change for each iteration and I am unsure of how to merge the two datasets effectively. The closest I have gotten was merging them where it would create two V1 columns, but that is obviously not something that I can use.