reindex {simplextree} | R Documentation |
reindexes vertex ids
Description
This function allows one to 'reorder' or 'reindex' vertex ids.
Usage
reindex(st, ids)
Arguments
st |
a simplex tree. |
ids |
vector of new vertex ids. See details. |
Details
The ids
parameter must be a sorted integer vector of new ids with length matching the
number of vertices. The simplex tree is modified to replace the vertex label at index i
with
ids
[i]. See examples.
Examples
st <- simplex_tree()
st %>% insert(1:3) %>% print_simplices("tree")
# 1 (h = 2): .( 2 3 )..( 3 )
# 2 (h = 1): .( 3 )
# 3 (h = 0):
st %>% reindex(4:6) %>% print_simplices("tree")
# 4 (h = 2): .( 5 6 )..( 6 )
# 5 (h = 1): .( 6 )
# 6 (h = 0):
[Package simplextree version 1.0.1 Index]