0

The first dataset is like this:

Major and letter grade

, and The second dataset is like this:

Specific Value

I want to add a new column in the first dataset with the corresponding value appear in the second table, but I don't know how to do it.

thelatemail
  • 91,185
  • 12
  • 128
  • 188
  • `specificvalue[as.matrix(majorgrade)]` should do it. You can index using the row and column values as a matrix. To get a definite answer, you should post your images as text though, so others can work with the test data. – thelatemail Oct 28 '19 at 05:06
  • Thank you for your answer, yes I use specificvalue[as.matrix(majorgrade)], and it works!!! You are brilliant!!! – Shkileo Oct 28 '19 at 05:20
  • Possible generic duplicate of https://stackoverflow.com/questions/6920441/index-values-from-a-matrix-using-row-col-indicies and here's another one that is nearly identical that i've answered previously: https://stackoverflow.com/questions/49885368/writing-a-function-that-looks-for-element-in-a-matrix-based-on-values-of-columns/49888458 – thelatemail Oct 28 '19 at 05:52

0 Answers0