.BG
.FN match
.TL
Match Items in Vector
.CS
match(x, table, nomatch=NA)
.AG x
vector of items that are to be looked for in `table'.
.AG table
the possible values in `x'.
.AG nomatch
the value to be returned when an item in `x' does not match any item in `table'.
A useful alternative to `NA' is `nomatch=0', which has the effect that
unmatched items are ignored when the matched indices are used in subscripts
(see the last example below).
.PP
.ne 4
.RT
vector like `x' giving, for each element of `x', the position
in `table' of the first `table[i]' equal to that element.
.SA
`amatch'.
.EX
match(data,primes)
state.abb[match(names,state.name)] #change names to abbrevs
names[match(allnames,names,0)] #those names also found in allnames
.KW manip
.WR
