ave() is your friend (unfortunately named as it may be):
> ave(dat$seq, dat$ts, FUN=cumsum)
[1] 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1
[39] 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3
> On 03 Apr 2015, at 14:17 , Morway, Eric wrote:
>
> This small example will be
On Apr 3, 2015, at 5:17 AM, Morway, Eric wrote:
> This small example will be applied to a problem with 1.4e6 lines of data.
> First, here is the dataset and a few lines of R script, followed by an
> explanation of what I'd like to get:
>
> dat <- read.table(textConnection("ISEG IRCH val
> 1
This small example will be applied to a problem with 1.4e6 lines of data.
First, here is the dataset and a few lines of R script, followed by an
explanation of what I'd like to get:
dat <- read.table(textConnection("ISEG IRCH val
11 265
12 260
13 234
54 39 467
54 40
3 matches
Mail list logo