Skip to content
Prev 170952 / 398503 Next

Re place Values within vector using Translation vector

The call to replace is replacing the 1st 3 elements of a (your indexes in Trans_CR) with the values and leaving the 4-6 elements alone.  For what you want, try:

A <- Trans_Prob_values[ match(a, Trans_CR) ]

Hope this helps,