I have a data frame which contains some data (Claims) and two additional columns, containing row and column information, for example:
Claim row Column
5000 2 10
etc.
I have a matrix that contains some data as well as NAs. I'd like to replace the NAs with the data from the data frame, using the row/column information. So 5000 would replace the NA in the matrix that is currently in row 2, column 10.
Is there an easy way to accomplish this with R?