View source: R/ctx_node_navigation.R
children | R Documentation |
This function returns a list (possibly empty) of ctx_node
objects. Each
object represents one of the children of the node represented by the node
parameter.
children(node)
## S3 method for class 'ctx_node'
children(node)
## S3 method for class 'ctx_node_cpp'
children(node)
node |
a |
Each node of a context tree represents a sequence. When find_sequence()
is
called with success, the returned object represents the corresponding node in
the context tree. If this node has no child, the present function returns an
empty list. When the node has at least one child, the function returns a list
with one value for each element in the state space (see states()
). The
value is NULL
if the corresponding child is empty, while it is a ctx_node
object when the child is present. Each ctx_node
object is associated to the
sequence obtained by adding to the past of the sequence represented by node
an observation of the associated state (this corresponds to an extension to
the left of the sequence in temporal order).
a list of ctx_node
objects, see details.
dts <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 0)
dts_ctree <- ctx_tree(dts, min_size = 1, max_depth = 3)
ctx_00 <- find_sequence(dts_ctree, c(0, 0))
## this context can only be extended in the past by 1:
children(ctx_00)
ctx_10 <- find_sequence(dts_ctree, c(1, 0))
## this context can be extended by both states
children(ctx_10)
## C++ backend
dts <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 0)
dts_ctree <- ctx_tree(dts, min_size = 1, max_depth = 3, backend = "C++")
ctx_00 <- find_sequence(dts_ctree, c(0, 0))
## this context can only be extended in the past by 1:
children(ctx_00)
ctx_10 <- find_sequence(dts_ctree, c(1, 0))
## this context can be extended by both states
children(ctx_10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.