Learn R Programming

forestry (version 0.1.1)

children_sort: Sort chidren nodes with certain order

Description

Sort chidren nodes with certain order

Usage

children_sort(input_node, input_order, mismatch_last = T)

Value

tree with children nodes sorted with certian order

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

Examples

Run this code
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)

Run the code above in your browser using DataLab