I would guess this is a duplicate, but I can\'t find that so here goes...
I\'d like to return the index of second in first:
first = c( \"a\" , \"c\"
Getting indexes of values is what match() is for.
match()
first = c( "a" , "c" , "b" ) second = c( "c" , "b" , "a" ) match(second, first) [1] 2 3 1