Try ave:
transform(df, v = ave(v, f, FUN = cumsum))
On Fri, Jan 8, 2010 at 1:10 PM, Daniel Murphy wrote:
> When the 'by' function forms subsets, are the rows in the same order as they
> are in the original data frame?
>
> For example, I want to use 'by' to calculate cumulative sums of a value '
Try this:
transform(df, v = unlist(with(df, tapply(v, f, cumsum
On Fri, Jan 8, 2010 at 4:10 PM, Daniel Murphy wrote:
> When the 'by' function forms subsets, are the rows in the same order as they
> are in the original data frame?
>
> For example, I want to use 'by' to calculate cumulative su
2 matches
Mail list logo