R match

June 2, 2010 by · Leave a Comment
Filed under: Notes 

> a <- 1:10 > b <- 4:6 > b[match(a, b)]
[1] NA NA NA 4 5 6 NA NA NA NA