Dear R users, I have a data.frame as follows
a b c d e [1,] 1 1 1 0 0 [2,] 1 1 0 0 0 [3,] 1 1 0 0 0 [4,] 0 1 1 1 1 [5,] 0 1 1 1 1 [6,] 1 1 1 1 1 [7,] 1 1 1 0 1 [8,] 1 1 1 0 1 [9,] 1 1 1 0 0 [10,] 1 1 1 0 0 Within these 4 vectors, I want to choose those vectors for which I have the pattern (0,0,1,1,1,1) occuring anywhere in the vector. This means I want vectors a,c,e and not b and d. Is there any grep feature which can help me do this? Thank you Apoorva -- Apoorva Gupta Consultant National Institute of Public Finance and Policy ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.