Difference between revisions of "OpasnetUtils/ComputeDependencies"
From Testiwiki
(Created page with "{{method|moderator=|stub="yes"}} Category:OpasnetUtils ==Description== Uses Fetch2, EvalOutput, CheckMarginals and CheckInput to load and pre-process upstream variables. Ty...") |
(new version) |
||
Line 12: | Line 12: | ||
showcode="1" | showcode="1" | ||
> | > | ||
− | # ComputeDependencies ############ uses Fetch2, EvalOutput, CheckMarginals and CheckInput to load and pre-process upstream variables | + | # 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) { | + | ComputeDependencies <- function(dependencies, ...) { |
Fetch2(dependencies) | Fetch2(dependencies) | ||
− | for (i in dependencies$Name) { | + | 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) | |
} | } | ||
} | } |
Revision as of 13:17, 26 June 2012
This page is a method.
The page identifier is Op_en5760 |
---|
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page, and then a rating bar will appear here. |
Upload data
|
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
# 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) } } |