From 8e709291eb56839b4b5a8f5bf712a53e3ece7d80 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 19 Oct 2015 15:52:16 +0200 Subject: Add a print method for mkinmod objects --- R/mkinmod.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'R') diff --git a/R/mkinmod.R b/R/mkinmod.R index 27716899..27b8410d 100644 --- a/R/mkinmod.R +++ b/R/mkinmod.R @@ -353,4 +353,20 @@ mkinmod <- function(..., use_of_ff = "min", speclist = NULL, quiet = FALSE, verb class(model) <- "mkinmod" return(model) } + +print.mkinmod <- function(x, ...) { + cat(" model generated with\n") + cat("Use of formation fractions $use_of_ff:", x$use_of_ff, "\n") + cat("Specification $spec:\n") + for (obs in names(x$spec)) { + cat("$", obs, "\n", sep = "") + spl <- x$spec[[obs]] + cat("$type:", spl$type) + if (!is.null(spl$to)) cat(", $to: ", spl$to, ", $sink: ", spl$sink, sep = "") + if (!is.null(spl$full_name)) if (!is.na(spl$full_name)) cat(", $full_name:", spl$full_name) + cat("\n") + } + if (is.matrix(x$coefmat)) cat("Coefficient matrix $coefmat available\n") + if (!is.null(x$cf)) cat("Compiled model $cf available\n") +} # vim: set foldmethod=marker ts=2 sw=2 expandtab: -- cgit v1.2.1