Calculates the levels in which the nodes will be distributed when plotting the structure. This level is defined by their parent nodes: a node with no parents will always be in the level 0. Subsequently, the level of a node will be one more of the maximum level of his parents.
node_levels(net, order, lvl = 1, acc = NULL)
the structure of the network.
a topological order of the nodes, with the orphan nodes
in the first place. See node.ordering
current level being processed
accumulator of the nodes already processed
a matrix with the names of the nodes in the first row and their level on the second