decide: Generate data frame of alternative values for a decision node

Description Usage Arguments Value See Also Examples

Description

decide uses lazyeval to evaluate the value functions of a decision node's children, i.e., alternatives.

Usage

1
decide(node, data = NULL)

Arguments

node

d_node. The decision node to evaluate.

data

List-like. The data to be used when evaluating the value functions. Depending on the value functions, omitting the data may result in an error.

Value

Data frame of alternatives and respective values.

See Also

Other node processing functions: evaluate

Examples

1
2
3
4
5
6
a <- o_node(v = ~ .data$x + y, "Add")
b <- o_node(v = ~ .data$x * y, "Multiply")
d <- d_node(children = list(a, b))
y <- 10
decide(d, data = list(x = 10))
decide(d, data = list(x = 1))

jongbinjung/datree documentation built on May 19, 2019, 7:30 p.m.