title: R Combining Matrices
body: <p>I have two Matrices, one is binary (Zero or One) and the other is an integer matrix of the same dimensions, these are square matrices.</p>
  
  <p>I'd like an efficient way of combining them in a specific way, without iteration along each element. </p>
  
  <p>The way I'd like to combine them is to have a resultant matrix from matrix A and matrix B, that for the element, takes the lowest number that is not zero. </p>
  
  <p>Can anyone think of a trick in R to achieve this, I've tried to do it mathematically but keep coming up short, I was wondering if there was a way to overlay the matrices with a conditional statement? </p>