define_model | R Documentation |
Basic constructor for decision tree classes for different data formats.
define_model(transmat, tree_dat, dat_long, ...)
transmat |
Transition probability matrix. Rows are from nodes and columns are to nodes. |
tree_dat |
Hierarchical tree structure of parents and children in a list of vectors with integer values. |
dat_long |
Long format data frame with from, to, prob, vals columns. |
... |
additional arguments |
transmat, tree_dat or dat_long class object
define_model(transmat = list(prob = matrix(data=c(NA, 0.5, 0.5), nrow = 1), vals = matrix(data=c(NA, 1, 2), nrow = 1) )) define_model(tree_dat = list(child = list("1" = c(2, 3), "2" = NULL, "3" = NULL), dat = data.frame(node = 1:3, prob = c(NA, 0.5, 0.5), vals = c(0, 1, 2)) )) define_model(dat_long = data.frame(from = c(NA, 1, 1), to = 1:3, prob = c(NA, 0.5, 0.5), vals = c(0, 1, 2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.