powered by
Traverse through tree/list to set node attributes, e.g. change icons. Useful for directory structure icons where inner nodes are directories, leafs are files.
set_node_attrs(tree, attr_name, inner_val, leaf_val)
named nested list
name of attribute to set
value of attribute for inner tree nodes
value of attribute for outer tree nodes
tree <- dfToTree(data.frame(Titanic), c("Sex", "Survived")) str(set_node_attrs(tree, attr_name = "sttype", inner_val = "directory", leaf_val = "file"))
Run the code above in your browser using DataLab