[Solved] R – Map one matrix (m.A) to another (m.C) based on P-value in (m.B)
set.seed(1) options(digits=4) mA <- matrix(runif(16), 4, 4); mA [,1] [,2] [,3] [,4] [1,] 0.266 0.202 0.6291 0.687 [2,] 0.372 0.898 0.0618 0.384 [3,] 0.573 0.945 0.2060 0.770 [4,] 0.908 0.661 0.1766 0.498 mB <- matrix(runif(16), 4, 4); mB [,1] [,2] [,3] [,4] [1,] 0.718 0.935 0.2672 0.870 [2,] 0.992 0.212 0.3861 0.340 [3,] 0.380 0.652 … Read more