Skip to contents

This function returns the sequence represented by the node object.

Usage

as_sequence(node, reverse)

Arguments

node

a ctx_node object as returned by find_sequence()

reverse

specifies whether the sequence should be reported in reverse temporal order (TRUE) or in the temporal order (FALSE). Defaults to the order associated to the ctx_node which is determined by the parameters of the call to contexts() or find_sequence().

Value

the sequence represented by the node object, a vector

Examples

dts <- c("A", "B", "C", "A", "A", "B", "B", "C", "C", "A")
dts_tree <- ctx_tree(dts, max_depth = 3)
res <- find_sequence(dts_tree, "A")
as_sequence(res)
#> [1] "A"