Hello,

I have two vectors of length = 10
x<-c(2,14,79,27,3,126,15,1,12,4)
y<-rep(4,10)

and I would like to create a third vector of length = 10 that contains the
smallest value at each position in the two above vectors.

I have tried:

z<-min(x,y)

but that doesn't work.

With the example data above, the third vector would look like this.

> z
 [1]   2  4  4  4   3 4  4   1  4   4

Any help with this would be much appreciated, thanks!

mark

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to