Learn R Programming

data.tree (version 0.2.0-3)

ClimbByAttribute: Find a Node by provided criteria.

Description

This method lets you climb the tree, from crutch to crutch. On each Node, the Climb finds the first child having attribute value equal to the the provided argument.

Usage

ClimbByAttribute(node, ..., recursive = FALSE)

Arguments

node

The root node of the tree or subtree to climb

...

an attribute name to searched value pairlist. For brevity, you can also provide a character vector.

recursive

If TRUE, then

Value

the Node having path ..., or NULL if such a path does not exist

See Also

Node

#

Examples

Run this code
# NOT RUN {
data(acme)

Aggregate(acme, attribute = "cost", aggFun = max, cacheAttribute = "cost")
ClimbByAttribute(acme, cost = function(x) x$parent$cost, recursive = TRUE)
# }

Run the code above in your browser using DataLab