-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of uka
Sent: Thursday, November 03, 2011 4:10 PM
To: r-help at r-project.org
Subject: Re: [R] how to count number of occurrences
This was very helpful. Thank you very much. Just one question, I notice
that
it does not count the number of X's before the first Y. I want the
result be
1 4 0 0 0 5 0 0 0 0. I tried combining this output with the first value
of
rle output, but realized that rle doesn't give me the 0s. So, if my
first
observation was Y, then I want it to show that there are 0 Xs before
that.
Thank you again.