children_sort {forestry} | R Documentation |
Sort chidren nodes with certain order
Description
Sort chidren nodes with certain order
Usage
children_sort(input_node, input_order, mismatch_last = T)
Arguments
input_node |
input node |
input_order |
children node order |
mismatch_last |
TRUE: mismatched children nodes are at the bottom; FALSE: mismatched nodes are at the top |
Value
tree with children nodes sorted with certian order
Examples
data(test_df)
test_node <- data.tree::as.Node(test_df)
sorted_node <- children_sort(
input_node = test_node,
input_order = c("groupB", "groupA"),
mismatch_last = TRUE)
print(sorted_node)
[Package forestry version 0.1.1 Index]