diff options
-rw-r--r-- | DESCRIPTION | 2 | ||||
-rw-r--r-- | NAMESPACE | 1 | ||||
-rw-r--r-- | NEWS.md | 2 | ||||
-rw-r--r-- | R/mkinmod.R | 16 | ||||
-rw-r--r-- | man/print.mkinmod.Rd | 19 |
5 files changed, 39 insertions, 1 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 365a325f..8aba93d1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Type: Package Title: Routines for Fitting Kinetic Models with One or More State Variables to Chemical Degradation Data Version: 0.9-40.900 -Date: 2015-10-16 +Date: 2015-10-19 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Katrin", "Lindenberger", role = "ctb"), @@ -1,5 +1,6 @@ # Export all names exportPattern(".") +S3method(print, mkinmod) S3method(plot, mkinfit) S3method(summary, mkinfit) S3method(print, summary.mkinfit) @@ -8,6 +8,8 @@ - Use an index.r file to group help topics in static documentation +- Add a printing method for mkinmod objects + ## mkin 0.9-40 (2015-07-21) ### Bug fixes 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("<mkinmod> 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:
diff --git a/man/print.mkinmod.Rd b/man/print.mkinmod.Rd new file mode 100644 index 00000000..fa02c1cb --- /dev/null +++ b/man/print.mkinmod.Rd @@ -0,0 +1,19 @@ +\name{print.mkinmod} +\alias{print.mkinmod} +\title{ + Print mkinmod objects +} +\description{ + Print mkinmod objects in a way that the user finds his way to get to its components. +} +\usage{ +\method{print}{mkinmod}(x, ...) +} +\arguments{ + \item{x}{ + An \code{\link{mkinmod}} object. + } + \item{\dots}{ + Not used. + } +} |