Index in r

which(myVector == 1)
# will return all the indices that satisfy the argument
Rocku0