Extract the nodes from the tree that are checked in a more convenient format. You can choose which format you prefer.
Usage
get_checked(
tree,
format = c("names", "slices", "classid"),
leaves_only = FALSE
)Arguments
- tree
The
input$treeshinyTree you want to inspect.- format
In which format you want the output. Use
namesto get a simple list of the names (with attributes describing the node's ancestry), orslicesto get a list of lists, each of which is a slice of the list used to get down to the checked node.classidgives each name with itsstclass,stidandid(jsTree's id for the node) attributes instead of its ancestry.- leaves_only
If
TRUE, return only checked nodes that have no children, leaving out checked parents. Withthree_state = TRUEa parent is checked whenever all of its children are, so this gives just the items that were ticked.
Value
A list with one element per checked node, descendants before their
ancestors, in the form format gives. An empty list if nothing is
checked or tree is NULL.