Skip to content
Prev 385568 / 398503 Next

fusion of two matrices (numerical and logical)

The result that I want to get is this:
for (i in 1:5) {
  for (j in 1:4) {
    B[i,j] <- ifelse(C[i,j]==FALSE,0,B[i,j])
  }
}
I would like to know if I can do this without loops.

Den l?r 5 sep. 2020 kl 20:18 skrev Vivek Sutradhara <viveksutra at gmail.com>: