Difference between revisions of "OpasnetUtils/Ovariable"

From Testiwiki
Jump to: navigation, search
(setclass.ovariable: marginal changed to type 'logical', prototype (defaults) added)
(changed the structure of the page)
Line 4: Line 4:
 
{{method|moderator=|stub=Yes}}
 
{{method|moderator=|stub=Yes}}
  
=movariable=
+
== Definition ==
==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==
+
=== Description ===
<rcode
+
Defines the S4 class "ovariable" which is the basic building block in open assessments
name="movariable"
 
label="Initiate functions"
 
graphics="1"
 
>
 
# 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>
 
  
 +
=== Code ===
  
 
=setclass.ovariable=
 
==Description==
 
Defines the S4 class "ovariable" which is the basic building block in open assessments.
 
 
==Code==
 
 
<rcode  
 
<rcode  
 
name="setclass.ovariable"  
 
name="setclass.ovariable"  
Line 71: Line 38:
 
</rcode>
 
</rcode>
  
=setmethod.make.ovariable=
+
== Constructor functions ==
==Description==
+
 
 +
=== <u>movariable</u> ===
 +
 
 +
==== Description ====
 +
 
 +
movariable takes a data.frame, a function, and a list and makes an ovariable out of them. It is a subfunction of [[OpasnetUtils/Ovariable#make.ovariable|make.ovariable]] and prevents infinite recursion of S4 methods.
 +
 
 +
==== Code ====
 +
<rcode
 +
name="movariable"
 +
label="Initiate functions"
 +
graphics="1"
 +
>
 +
# 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>
 +
 
 +
=== <u>make.ovariable</u> ===
 +
====Description====
 
make.ovariable takes a vector or data.frame and makes an ovariable out of it.
 
make.ovariable takes a vector or data.frame and makes an ovariable out of it.
  
==Code==
+
====Code====
 
<rcode  
 
<rcode  
 
name="make.ovariable"  
 
name="make.ovariable"  

Revision as of 09:53, 15 June 2012



Definition

Description

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

Code

+ Show code

Constructor functions

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

make.ovariable

Description

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

Code

+ Show code

See also