'If a "location" in one data frame is equal to another, how get I get that value?
I have a data frame that looks like a matrix and I want to import value based on where they are, but only if they match the exact "coordinates" of another data frame. i.e df1[1,2] = df2[1,2], so I want the value from df2 based on the location of df1.
df1
df2
So for the data frames above (which are just transposed versions of each other), I am looking to return the value when columns and rows match. So in pseudo terms, "If Column name Gamma from df1 matches Row name Gamma from df2, and Row name Three from df1 matches Column name Three in df2, return 36." Or "If value is not NA, and it is in the same [x,y] location, return that value."
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


