[R] detect subset in series

threshold r.kozarski at gmail.com
Wed Nov 16 14:25:14 CET 2011


Dear R Users, I am curious whether there is any simple solution o my problem.

My example 'series':
series <- c(1,1,1,0,1,0,0,1,1,0,0,0,0,1)

My 'subset' of interest:
subset <- c(0,0,0,0)

Is there any function which tells me that the subset exists in my series,
and gives me position where in series is starts. In provided example the
subset exists and covers the elements 10:13 of the 'series'.

Thanks a lot , robert

--
View this message in context: http://r.789695.n4.nabble.com/detect-subset-in-series-tp4076285p4076285.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list