Learn R Programming

mixvlmc (version 0.2.1)

depth: Depth of a context tree

Description

This function returns the depth of a context tree, i.e. the length of the longest context represented in the tree.

Usage

depth(ct)

Value

the depth of the tree.

Arguments

ct

a context tree.

Examples

Run this code
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 3
depth(dts_ctree)

Run the code above in your browser using DataLab