R/getTree.R

Defines functions getTree

Documented in getTree

getTree <-
function(mstObj, Ga = c("0", "2", "3", "4", "log_n")) {
  Ga <- match.arg(as.character(substitute(Ga)), c("0", "2", "3", "4", "log_n"))
  if (Ga == 0) {
    if (is.null(mstObj$tree0)) { stop("No initial tree in ", deparse(substitute(mstObj)))
    } else { return(mstObj$tree0) }
  } else {
    if (is.null(mstObj$best.tree.structure)) { stop("No best-sized tree in ", deparse(substitute(mstObj)))
    } else { return(mstObj$best.tree.structure[[paste0("Ga.", Ga)]]) }
  }
}

Try the MST package in your browser

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

MST documentation built on April 14, 2020, 6:14 p.m.