I have a table where I need to choose all the values in the Data column, match with the column names and take the value from that row. Ex. Data column: choose A1, find colu
What about this?
df[cbind(1:4, match(df$Data, names(df)))] [1] "1" "6" "11" NA