Cumulate values among siblings
For example, you can sum up values of siblings before
this Node
.
Cumulate(node, attribute, aggFun, ...)
node |
The node on which we want to cumulate |
attribute |
determines what is collected. The
|
aggFun |
the aggregation function to be applied to the children's |
... |
any arguments to be passed on to attribute (in case it's a function) |
data(acme) acme$Do(function(x) x$cost <- Aggregate(x, "cost", sum), traversal = "post-order") acme$Do(function(x) x$cumCost <- Cumulate(x, "cost", sum)) print(acme, "cost", "cumCost")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.