Skip to content
Prev 385685 / 398503 Next

fusion of two matrices (numerical and logical)

Here is a way of doing it using the 'arr.ind' option in 'which'
[,1] [,2] [,3] [,4]
[1,]    1    6   11   16
[2,]    2    7   12   17
[3,]    3    8   13   18
[4,]    4    9   14   19
[5,]    5   10   15   20
[,1]  [,2]  [,3]  [,4]
[1,] TRUE  TRUE FALSE FALSE
[2,] TRUE FALSE FALSE FALSE
[3,] TRUE FALSE FALSE FALSE
[4,] TRUE FALSE FALSE  TRUE
[5,] TRUE FALSE FALSE FALSE
[,1] [,2] [,3] [,4]
[1,]    1    6    0    0
[2,]    2    0    0    0
[3,]    3    0    0    0
[4,]    4    0    0   19
[5,]    5    0    0    0
Jim Holtman
*Data Munger Guru*


*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*
On Sat, Sep 5, 2020 at 11:51 AM Bert Gunter <bgunter.4567 at gmail.com> wrote: