I have two 'data.frame's
: df1
has 2000 rows(ID) and 100 columns with values matching the names of columns in df2
. df2
has 50 rows named q1
through q50
and 11 columns named 1 through 11.
Every two columns in df1
correspond to a row in df2
. Column 1 and 2 in df1
correspond to row q1
in df2
, column 3 and 4 correspond to row q2
, and so on. See an example of the data frames here : df1 df2.
I want to create a third data.frame with dimensions the same as df1
. The values in this frame df3
should replace the column name in d1
with the corresponding q row's column value in df2
.
Here is an example df3 based on the provided df1 and df2 : df3
How can I achieve this?