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.

#node$Climb(...)
Climb(node, ...)

Arguments

node

The root Node of the tree or subtree to climb

...

an attribute-value pairlist to be searched. For brevity, you can also provide a character vector to search for names.

Value

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

See also

Examples

data(acme)

#the following are all equivalent
Climb(acme, 'IT', 'Outsource')
#>   levelName
#> 1 Outsource
Climb(acme, name = 'IT', name = 'Outsource')
#>   levelName
#> 1 Outsource
Climb(acme, 'IT')$Climb('Outsource')
#>   levelName
#> 1 Outsource
Navigate(acme, path = "IT/Outsource")
#>   levelName
#> 1 Outsource

Climb(acme, name = 'IT')
#>         levelName
#> 1 IT             
#> 2  ¦--Outsource  
#> 3  ¦--Go agile   
#> 4  °--Switch to R

Climb(acme, position = c(2, 1))
#>          levelName
#> 1 New Product Line
#or, equivalent:
Climb(acme, position = 2, position = 1)
#>          levelName
#> 1 New Product Line
Climb(acme, name = "IT", cost = 250000)
#>   levelName
#> 1  Go agile

tree <- CreateRegularTree(5, 2)
tree$Climb(c("1", "1"), position = c(2, 2))$path
#> NULL