R/listIntoTree.R

Defines functions listIntoTree

Documented in listIntoTree

listIntoTree <-
function(tree, data, formula, weights) {

  nodes <- listIntoParty(tree, data = data)
  Vs <- all.vars(formula)

  fitted <- fitted_node(nodes, data = data)
  response <- data[ , 1]
  ret <- party(nodes, data = data,
               fitted = data.frame("(fitted)" = fitted,
                                   "(response)" = response,
                                   "(weights)" = weights,
                                   check.names = FALSE, stringsAsFactors=FALSE),
               terms = terms(formula))
  return(as.constparty(ret))
}

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.