Displaying 1 result from an estimated 1 matches for "cumvalue".
Did you mean:
cum_value
2011 May 06
1
Cumsum in Lattice Panel Function
...value = rnorm(length(dates)*length(g)) + 0.05)
xyplot(value ~ date, data = dat, group = group, type = 'l', grid = TRUE,
panel = panel.superpose,
panel.groups = function(x, y, ...) { panel.xyplot(x, cumsum(y), ...)
})
I want the result to look the same as if I had done
dat$cumvalue <- with(dat, unsplit(lapply(split(value, group), cumsum),
group))
xyplot(cumvalue ~ date, data = dat, group = group, type = 'l', grid = TRUE)
Thanks for your help.
- Elliot
--------------------------------
Elliot Joel Bernstein, Ph.D. | Research Associate | FDO Partners, LLC
134 Mount...