Skip to content
Prev 278522 / 398503 Next

perfectionism

I have a named vector:
I want to know the index in z of the first occurrence of each of the values in f.

One implementation is
b c
2 3

Is which() smart enough to stop when it finds in z the first occurrence of every
value from f, or does it search through all the values in z only to report the
first one?

Are some more elegant ways of writing this code?

Just curious.