# NOT RUN {
## Starter example complex
st <- simplex_tree()
st %>% insert(list(1:3, 2:5))
## Print out complex using depth-first traversal.
st %>% preorder() %>% traverse(print)
## Collect the last labels of each simplex in the tree.
last_labels <- st %>% preorder() %>% straverse(function(simplex){ tail(simplex, 1) })
# }
Run the code above in your browser using DataLab