Skip to content
Prev 32715 / 398528 Next

function to populate a matrix based on a lookup to another matrix ?

peter leonard wrote:
dd <- lookup[as.numeric(rownames(dd)), as.numeric(colnames(dd))]
and after that restoring dd's row- and colnames.

Anyway, I guess you don't need to create "dd". Just calculate those 
rownames (rn) and colnames (cn) as integers. Then the following works:

  dd <- lookup[rn, cn]

Uwe Ligges