Learn R Programming

OpasnetUtils (version 1.3)

EvalOutput: Evaluate ovariable output

Description

Evaluate the output slot of an ovariable, which usually means recursively evaluating any dependent variables as well.

Usage

EvalOutput(variable, fillna = FALSE, indent = 0, verbose = FALSE, ...)

Arguments

variable
fillna

if TRUE, fillna is attempted at the end

indent

internal integer argument used in verbose printing

verbose

use TRUE to enable status messages while processing outputs and various checks

arguments are passed on to ovariable formulas and to dependent EvalOutput calls (recursivity), number of iterations (N) is commonly set here

Value

Returns the input ovariable with the output slot (re)defined.

Details

EvalOutput automates most of the other features related to ovariable handling. It runs ComputeDependencies first, produces a data.frame by combining the return values from interpreting the data slot and running the formula slot function, makes a "Source" -column to distinguish between the two "Results" and lastly CheckMarginals is run on the variable (optionally also fillna).

Since EvalOutput is usually run on the end node of a model, there should not be inputs or decisions hence they are not checked for. In contrast ComputeDependencies runs all Checks besides CheckMarginals.

See also: http://en.opasnet.org/

Examples

Run this code
a <- Ovariable("a", data.frame(A = c("a", "b"), Result = c("1-2", "1-4")))
a <- EvalOutput(a, N = 10)
a@output

Run the code above in your browser using DataLab