| TreeNode | R Documentation |
A node of a tree shown by tree_view(). See tree_node().
labelText shown for the node.
dataAny R value attached to the node.
idOptional identifier.
loaderNULL or function(node) returning children, called
the first time the node is expanded.
loadedHas the loader run?
parentThe parent node (read-only).
childrenChild nodes (read-only).
expandedIs the node expanded? (assign to expand / collapse)
TreeNode$new()Create a node. See tree_node().
TreeNode$new( label, children = list(), data = NULL, expanded = FALSE, id = NULL, loader = NULL )
labelLabel.
childrenChild nodes (or labels).
dataAttached value.
expandedStart expanded?
idIdentifier.
loaderLazy loader.
TreeNode$add()Add a child.
TreeNode$add(node, data = NULL, expanded = FALSE)
nodeA TreeNode or a label.
dataData for a node created from a label.
expandedExpanded state for a node created from a label.
The child node.
TreeNode$remove()Detach the node from its parent.
TreeNode$remove()
TreeNode$clear()Remove all children.
TreeNode$clear()
TreeNode$expand()Expand the node (running the loader if needed).
TreeNode$expand()
TreeNode$collapse()Collapse the node.
TreeNode$collapse()
TreeNode$toggle()Toggle between expanded and collapsed.
TreeNode$toggle()
TreeNode$expandable()Can the node be expanded?
TreeNode$expandable()
TreeNode$depth()Depth below the root (the root is 0).
TreeNode$depth()
TreeNode$ancestors()Parent, grandparent, ... up to the root.
TreeNode$ancestors()
TreeNode$path()Labels from the root to this node.
TreeNode$path()
TreeNode$walk()This node and all descendants (depth first).
TreeNode$walk()
TreeNode$find()Find a descendant by id.
TreeNode$find(id)
idIdentifier.
TreeNode$changed()Notify the tree view that the node changed.
TreeNode$changed()
TreeNode$print()Print the subtree.
TreeNode$print(...)
...Ignored.
TreeNode$clone()The objects of this class are cloneable with this method.
TreeNode$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.