# NOT RUN {
RootedTreeShape(PectinateTree(8))
plot(RootedTreeWithShape(0, nTip = 8L))
NRootedShapes(8L)
# Shapes are numbered from 0 to NRootedShapes(n) - 1. The maximum shape is:
RootedTreeShape(BalancedTree(8))
# Unique shapes of unrooted trees:
NUnrootedShapes(8L)
# Keys of these trees:
UnrootedKeys(8L)
# A tree may be represented by multiple keys.
# For a one-to-one correspondence, use a number instead:
allShapes <- lapply(seq_len(NUnrootedShapes(8L)) - 1L,
UnrootedTreeWithShape, 8L)
plot(allShapes[[1]])
sapply(allShapes, UnrootedTreeShape)
sapply(allShapes, UnrootedTreeKey) # Key >= number
# }
Run the code above in your browser using DataLab