# # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- a = 2 x = c(1,2,3,4,2,2,3) match(a,x) which(x==a) min(which(x==a)) x1 = c(1,2,3,4,5) x2 = c(0,2,3,4,7) match(x1,x2) which(x1==x2) # test for memebership a %in% x