Cumulate | R Documentation |
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.