as_sequence: Extract the sequence encoded by a node

View source: R/ctx_node.R

as_sequenceR Documentation

Extract the sequence encoded by a node

Description

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)

mixvlmc documentation built on June 8, 2025, 12:35 p.m.