title: How many times occur pair of 1 in a vector
body: <p>i have a problem.</p>
  
  <p>I have a vector, that consists from 0 or 1 - for example (011011111011100001111). In R i need to figure out, how to count how many times appears in vector two 1, three 1, four 1 and so on. In this example vector I have 1 times 11, 1 times 111, 1 times 1111 and 1 times 11111.</p>
  
  <p>Thanks a lot, Peter </p>