OpasnetUtils/Print: Difference between revisions

From Opasnet
Jump to navigation Jump to search
mNo edit summary
(code replaced with link to code)
 
Line 8: Line 8:


==Code==
==Code==
<rcode
name="setmethod.print"
label="Initiate functions"
graphics="1"
showcode="1"
>
# SETMETHOD PRINT ######################## print ovariable contents


temp <- setMethod(
https://www.opasnet.org/svn/opasnet_utils/trunk/R/Print.r
f = "print",
signature = signature(x = "oassessment"),
definition = function(x) {
cat("Dependencies\n")
print(xtable(x@dependencies), type = 'html')
cat("Decisions\n")
print(xtable(x@decisions), type = 'html')
cat("Stakeholders\n")
print(xtable(x@stakeholders), type = 'html')
cat("Probabilities\n")
print(xtable(x@probabilities), type = 'html')
 
cat("\n\nThe list of variables in this assessment.\n")
for(k in 1:length(x@vars)) {
cat("<b>Variable", names(x@vars)[k], "</b> <p>\n\n")
print(x@vars[[k]])
}
}
)
 
temp <- setMethod(
f = "print",
signature = signature(x = "ovariable"),
definition = function(x, iter = 1) {
cat("<b>Ovariable", x@name, "</b>\n")
cat("Output\n")
print(xtable(x@output[x@output$Iter %in% iter, ]), type = 'html')
cat("Formula\n")
print(x@formula)
cat("Dependencies\n")
print(x@dependencies)
}
)
</rcode>


==See also==
==See also==

Latest revision as of 13:59, 16 August 2012



Description

Print ovariable contents

Code

https://www.opasnet.org/svn/opasnet_utils/trunk/R/Print.r

See also