|
|
(3 intermediate revisions by one other user not shown) |
Line 1: |
Line 1: |
− | [[Category:Opasnet]] | + | #REDIRECT [[OpasnetUtils]] |
− | [[Category:R tools]]
| |
− | [[Category:OpasnetUtils]]
| |
− | {{method|moderator=|stub=Yes}}
| |
− | | |
− | ==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"
| |
− | >
| |
− | # 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>
| |
− | | |
− | ==See also==
| |
− | | |
− | * [[OpasnetBaseUtils]]
| |
− | * [[Object-oriented programming in Opasnet]]
| |
− | * [[Opasnet (R library)]]
| |