acc_successions {dbnR}R Documentation

Returns a vector with the number of consecutive nodes in each level

Description

This method processes the vector of node levels to get the position of each node inside the level. E.g. c(1,1,1,2,2,3,4,4,5,5) turns into c(1,2,3,1,2,1,1,2,1,2)

Usage

acc_successions(nodes, res = NULL, prev = 0, acc = 0)

Arguments

nodes

a vector with the level of each node

res

the accumulative results of the sub successions

prev

the level of the previous node processed

acc

the accumulator of the index in the current sub successions

Value

the vector of sub successions in each level


[Package dbnR version 0.7.8 Index]