context_number: Number of contexts of a context tree

View source: R/ctx_tree.R

context_numberR Documentation

Number of contexts of a context tree

Description

This function returns the number of distinct contexts in a context tree.

Usage

context_number(ct)

Arguments

ct

a context tree.

Value

the number of contexts of the tree.

Examples

dts <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 0)
dts_ctree <- ctx_tree(dts, min_size = 1, max_depth = 3)
# should be 8
context_number(dts_ctree)

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