I have a matrix and a vector like this:
Matrix<-cbind(c(3,3,5,1),c(2,5,2,1))
Vector<-c(2,3,3,3)
I want to replace the Matrix elements that are >= the corresponding Vector value with the values in the Vector so that the Matrix would now look like this:
MatrixNew<-cbind(c(2,3,3,1),c(2,3,2,1))
What logic would achieve this?