R/VLMCX_depth.R

Defines functions VLMCX_depth.default VLMCX_depth

VLMCX_depth <- function(VLMCXtree)UseMethod("VLMCX_depth")


## recursive function that returns the maximum depth of the tree
VLMCX_depth.default <- function(VLMCXtree)
{
  
  if (length(VLMCXtree$child) == 0)
      result = 0
  else
  {
    depth.children = 0
    for (ind in 1:length(VLMCXtree$child))
      depth.children[ind] = VLMCX_depth(VLMCXtree$child[[ind]])
    result = 1 + max(depth.children)
      
  }
  return(result)
}

Try the VLMCX package in your browser

Any scripts or data that you put into this service are public.

VLMCX documentation built on May 29, 2024, 11:04 a.m.