SyntaxFix
Write A Post
Hire A Developer
Questions
the function Position in funprog {base} also does the job. It allows you to pass an arbitrary function, and returns the first or last match.
Position
Position(f, x, right = FALSE, nomatch = NA_integer)