Difference between revisions of "OpasnetUtils/Ovariable"

From Testiwiki
Jump to: navigation, search
m
(setclass.ovariable: marginal changed to type 'logical', prototype (defaults) added)
Line 50: Line 50:
 
>
 
>
 
# SETCLASS OVARIABLE ################### Defines the S4 class "ovariable" which is the basic building block in open assessments.
 
# SETCLASS OVARIABLE ################### Defines the S4 class "ovariable" which is the basic building block in open assessments.
temp <- setClass(
+
setClass(
 
"ovariable",  
 
"ovariable",  
 
representation(
 
representation(
name         = "character",
+
name = "character",
output       = "data.frame",  
+
output = "data.frame",  
data         = "data.frame",  
+
data = "data.frame",  
marginal     = "vector",  
+
marginal = "logical",  
formula     = "function",  
+
formula = "function",  
dependencies = "data.frame"
+
dependencies = "data.frame"
 +
),
 +
prototype = prototype(
 +
name = character(),
 +
output = data.frame(),
 +
data = data.frame(),
 +
marginal = logical(),
 +
formula = function(...){0},
 +
dependencies = data.frame()
 
)
 
)
 
)
 
)
 
</rcode>
 
</rcode>
 
 
  
 
=setmethod.make.ovariable=
 
=setmethod.make.ovariable=

Revision as of 09:42, 15 June 2012



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

+ Show code


setclass.ovariable

Description

Defines the S4 class "ovariable" which is the basic building block in open assessments.

Code

+ Show code

setmethod.make.ovariable

Description

make.ovariable takes a vector or data.frame and makes an ovariable out of it.

Code

+ Show code

See also