0

I created a data.tree and now I want to add a specific number of the nodes such that.. Oh leave it, I will give example......

CEO
2 ¦--CXO N-2
3 ¦ ¦--HOD N-3
4 ¦ ¦ ¦--Manager N-4 5 ¦ ¦ ¦ ¦--Resource N-5
6 ¦ ¦ ¦ ¦--Resource N-5

You see how the alphanumeric coding changes as the node change.

You can use the original acme dataset to give this out to me.

library (data.tree) data(acme)

As I did research, I found Node$Set, probably it has something to do with assigning characters/numerics to nodes, but sadly I am unable to figure out how.

# node$Set(..., 
#          traversal = c("pre-order", "post-order", "in-order", "level", "ancestor"),  
#          pruneFun = NULL, 
#          filterFun = NULL)
#traditional:
Set(nodes, ...)

Please note I have found similar question, but it adds incremental value to every node instead of giving values to specific node and also understand I want to add alphanumeric...

https://stackoverflow.com/a/33462650/5785085

Rana Usman
  • 1,031
  • 7
  • 21

0 Answers0