Merging two vectors at random in R
===

I have two vectors x and y. x is a larger vector compared to y. For example (x is set to all zeros here, but that need not be the case)

    x = rep(0,20)
    y = c(2,3,-1,-1)

What I want to accomplish is overlay some y's in x but at random. So in the above example, x would look like

    0,0,2,3,-1,-1,0,0,0,0,2,3,-1,-1,... 

Basically, I'll step through each value in x, pull a random number, and if that random number is less than some threshold, I want to overlay y for the next 4 places in x unless I've reached the end of x. Would any of the apply functions help? Thanks much in advance.
