R/treesize.R

Defines functions treesize

Documented in treesize

treesize <- function(x, terminal=TRUE) {
  if(!inherits(x, "RRF"))
    stop("This function only works for objects of class `RRF'")
  if(is.null(x$forest)) stop("The object must contain the forest component")
  if(terminal) return((x$forest$ndbigtree+1)/2) else return(x$forest$ndbigtree)
}

Try the RRF package in your browser

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

RRF documentation built on May 31, 2022, 1:05 a.m.