Aggregating values on a data tree with R
问题 I'm trying to tally up the hours from a data tree structure. I can add up the hours directly under parent node, but I can't include the hours assigned to the parent nodes in the tree. Any suggestions would be great. This is what I am getting: levelName hours totalhours 1 Ned NA 1 2 °--John 1 3 3 °--Kate 1 3 4 ¦--Dan 1 1 5 ¦--Ron 1 1 6 °--Sienna 1 1 This is what I'm looking for: levelName hours totalHours 1 Ned NA 5 2 °--John 1 5 3 °--Kate 1 4 4 ¦--Dan 1 1 5 ¦--Ron 1 1 6 °--Sienna 1 1 Here's