OpasnetUtils/Oassessment: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 90: | Line 90: | ||
) | ) | ||
) | ) | ||
</rcode> | |||
=movariable= | |||
==Description== | |||
movariable takes a data.frame, a function, and a list and makes an ovariable out of them. It is a subfunction of [[make.ovariable]] and prevents infinite recursion of S4 methods. | |||
==Code== | |||
<rcode | |||
name="answer" | |||
label="Initiate functions" | |||
graphics="1" | |||
> | |||
library(OpasnetBaseUtils) | |||
library(xtable) | |||
n <- 5 | |||
# MOVARIABLE ########## movariable takes a data.frame, a function, and a list and makes an ovariable out of them. It is a | |||
#####subfunction of make.ovariable and prevents infinite recursion of S4 methods. | |||
movariable <- function( | |||
data, | |||
formula, | |||
dependencies, | |||
name | |||
) { | |||
output <- interpret(data) | |||
out <- new("ovariable", | |||
name = name, | |||
output = output, | |||
data = data, | |||
marginal = ifelse(colnames(output) %in% c("Result", "Unit"), FALSE, TRUE), | |||
formula = formula, | |||
dependencies = dependencies | |||
) | |||
out <- update(out) | |||
return(out) | |||
} | |||
</rcode> | </rcode> |
Revision as of 11:06, 14 June 2012
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page. |
Upload data
|
make.oassessment
Description
make.oassessment creates S4 assessment from dependencies data.frame, including decisions, stakeholders, probabilities, and variables.
NOTE! You must include the formula code from each variable page, otherwise formulas and dependencies are not updated.
Parameters
Dependencies
- a data.frame that has the structure of oassessment@name (Columns: Name, Identifier, Direction, Result)
Code
setclass.oassessment
Description
Defines the S4 class "oassessment" which is the object type for open assessments.
Code
movariable
Description
movariable takes a data.frame, a function, and a list and makes an ovariable out of them. It is a subfunction of make.ovariable and prevents infinite recursion of S4 methods.