indexing in r programming code example Example: index in r which(myVector == 1) # will return all the indices that satisfy the argument