Hi All,

I have a vector with repeated values like

> x2[1:30]
 [1]  0  6 18  0  6 18  0  6 18  0  6 18  0  6 18  0  6 18  0  6 18  0  6
18  0  6 18  0  6 18

I want to search the sequence in this vector. And search should give me the
index of matching sequence. For example. I want to search the sequence 18 0
6 in this vector, so it should return me at least the starting point of the
sequence. In this case it would be 3, 6, 9,... and so on. What function can
I use? I looked for the function grep, but it needs the data to be converted
in string, and it returns only true or false, but I want the index where it
is matched.

Thanks you very much. Any help is appreciated.

Narayani Barve

	[[alternative HTML version deleted]]

