a <- c(-1, 0, 2, 3)
b <- c(0, 2, 9, -3)
I have 2 vectors here of equal length. I want to find the value that is the maximum of the 2 vectors element-wise. That is, I want to compare the first element of a
and b
and find the bigger value, then compare the second, third, etc. I want the final vector to be 0, 2, 9, 3
.