Skip to content

A little problem

2 messages · "Unternährer Thomas, uth", Brian Ripley

#
Hi,

Does anybody knows a easy way (without for-loops, maybe with something like match) 
to solve this problem:

x <- rep(1,3)
y <- c(0,1,0,1,0,1,1,1,0,0,0,0,1,0)

if (x is a part of y){
 find out where it is and
 do something
}


Thanks a lot

Thomas
#
On Tue, 5 Aug 2003, "Untern?hrer Thomas, uth" wrote:

            
I'll assume the contents are 0/1.
[1] 6
attr(,"match.length")
[1] 3