Possible Duplicate:
Compute the minimum of a pair of vectors
I have two vectors of the same length:
a <- rnorm(40)
b <- rnorm(40)
Now, I want to create a third vector c which has a each point the minor value of a and b. This could be a solution:
for (i in 1:40)
{c[i] <- min(a[i],b[i])}
However, I guess there is an easier way to do this.