OpasnetUtils/ComputeDependencies

From Testiwiki
Revision as of 13:17, 26 June 2012 by Teemu R (talk | contribs) (new version)
Jump to: navigation, search

Description

Uses Fetch2, EvalOutput, CheckMarginals and CheckInput to load and pre-process upstream variables. Typically seen on the first line of ovariable formula code.

Code

- Hide code

# ComputeDependencies ############ uses Fetch2, EvalOutput, CheckMarginals and CheckInput to load and pre-process
# upstream variables. Typically seen on the first line of ovariable formula code. 
# '...' can be used for input substitution, na.rm, number of iterations (N) and others

ComputeDependencies <- function(dependencies, ...) { 
	Fetch2(dependencies)
	for (i in as.character(dependencies$Name)) {
		assign(i, EvalOutput(get(i), ...), envir = .GlobalEnv)
		assign(i, CheckMarginals(get(i), ...), envir = .GlobalEnv)
		assign(i, CheckInput(get(i), ...), envir = .GlobalEnv)
	}
}

See also