aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-03-31 09:52:19 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-03-31 10:31:16 +0200
commit64a476750ff57f4c612620bd58cc4ac42812e185 (patch)
tree8b1701eb380ce1bd553c751a6a7347f5c3e66ef4
parentf9e0c46378f090a04fe95c70bb7977a686679895 (diff)
Use inline documentation for R6 class mkinds
-rw-r--r--R/mkinds.R53
-rw-r--r--docs/reference/mkinds.html64
-rw-r--r--docs/reference/print.mkinds.html6
-rw-r--r--man/mkinds.Rd55
-rw-r--r--man/print.mkinds.Rd2
-rw-r--r--test.log45
6 files changed, 126 insertions, 99 deletions
diff --git a/R/mkinds.R b/R/mkinds.R
index a66adb14..d6f296bf 100644
--- a/R/mkinds.R
+++ b/R/mkinds.R
@@ -1,43 +1,50 @@
#' A dataset class for mkin
#'
-#' A dataset class for mkin
-#'
-#' @name mkinds
-#' @docType class
-#' @format An \code{\link{R6Class}} generator object.
-#' @section Fields:
-#'
-#' \describe{ \item{list("title")}{A full title for the dataset}
-#'
-#' \item{list("sampling")}{times The sampling times}
-#'
-#' \item{list("time_unit")}{The time unit}
-#'
-#' \item{list("observed")}{Names of the observed compounds}
-#'
-#' \item{list("unit")}{The unit of the observations}
-#'
-#' \item{list("replicates")}{The number of replicates}
-#'
-#' \item{list("data")}{A dataframe with at least the columns name, time and
-#' value in order to be compatible with mkinfit} }
+#' @description
+#' At the moment this dataset class is hardly used in mkin. For example,
+#' mkinfit does not take mkinds datasets as argument, but works with dataframes
+#' such as the on contained in the data field of mkinds objects. Some datasets
+#' provided by this package come as mkinds objects nevertheless.
+#'
#' @importFrom R6 R6Class
-#' @keywords datasets
+#' @seealso The S3 printing method \code{\link{print.mkinds}}
#' @examples
#'
#' mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
+#' print(mds)
#'
#' @export
mkinds <- R6Class("mkinds",
public = list(
+
+ #' @field title A full title for the dataset
title = NULL,
+
+ #' @field sampling_times The sampling times
sampling_times = NULL,
+
+ #' @field time_unit The time unit
time_unit = NULL,
+
+ #' @field observed Names of the observed variables
observed = NULL,
+
+ #' @field unit The unit of the observations
unit = NULL,
+
+ #' @field replicates The maximum number of replicates per sampling time
replicates = NULL,
+
+ #' @field data A data frame with at least the columns name, time
+ #' and value in order to be compatible with mkinfit
data = NULL,
+ #' @description
+ #' Create a new mkinds object
+ #' @param title The dataset title
+ #' @param data The data
+ #' @param time_unit The time unit
+ #' @param unit The unit of the observations
initialize = function(title = "", data, time_unit = NA, unit = NA) {
self$title <- title
@@ -56,8 +63,6 @@ mkinds <- R6Class("mkinds",
#' Print mkinds objects
#'
-#' Print mkinds objects.
-#'
#' @param x An \code{\link{mkinds}} object.
#' @param \dots Not used.
#' @export
diff --git a/docs/reference/mkinds.html b/docs/reference/mkinds.html
index c1cdcf99..ef6fb35c 100644
--- a/docs/reference/mkinds.html
+++ b/docs/reference/mkinds.html
@@ -36,7 +36,10 @@
<meta property="og:title" content="A dataset class for mkin — mkinds" />
-<meta property="og:description" content="A dataset class for mkin" />
+<meta property="og:description" content="At the moment this dataset class is hardly used in mkin. For example,
+mkinfit does not take mkinds datasets as argument, but works with dataframes
+such as the on contained in the data field of mkinds objects. Some datasets
+provided by this package come as mkinds objects nevertheless." />
<meta name="twitter:card" content="summary" />
@@ -133,36 +136,36 @@
</div>
<div class="ref-description">
- <p>A dataset class for mkin</p>
+ <p>At the moment this dataset class is hardly used in mkin. For example,
+mkinfit does not take mkinds datasets as argument, but works with dataframes
+such as the on contained in the data field of mkinds objects. Some datasets
+provided by this package come as mkinds objects nevertheless.</p>
</div>
- <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
+ <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
- <p>An <code>R6Class</code> generator object.</p>
- <h2 class="hasAnchor" id="fields"><a class="anchor" href="#fields"></a>Fields</h2>
+ <div class='dont-index'><p>The S3 printing method <code><a href='print.mkinds.html'>print.mkinds</a></code></p></div>
+ <h2 class="hasAnchor" id="public-fields"><a class="anchor" href="#public-fields"></a>Public fields</h2>
-
-
-
-<dl class='dl-horizontal'>
-<dt>list("title")</dt><dd><p>A full title for the dataset</p></dd>
+ <p><div class="r6-fields"></p><dl class='dl-horizontal'>
+<dt><code>title</code></dt><dd><p>A full title for the dataset</p></dd>
-<dt>list("sampling")</dt><dd><p>times The sampling times</p></dd>
+<dt><code>sampling_times</code></dt><dd><p>The sampling times</p></dd>
-<dt>list("time_unit")</dt><dd><p>The time unit</p></dd>
+<dt><code>time_unit</code></dt><dd><p>The time unit</p></dd>
-<dt>list("observed")</dt><dd><p>Names of the observed compounds</p></dd>
+<dt><code>observed</code></dt><dd><p>Names of the observed variables</p></dd>
-<dt>list("unit")</dt><dd><p>The unit of the observations</p></dd>
+<dt><code>unit</code></dt><dd><p>The unit of the observations</p></dd>
-<dt>list("replicates")</dt><dd><p>The number of replicates</p></dd>
+<dt><code>replicates</code></dt><dd><p>The maximum number of replicates per sampling time</p></dd>
-<dt>list("data")</dt><dd><p>A dataframe with at least the columns name, time and
-value in order to be compatible with mkinfit</p></dd>
-</dl>
+<dt><code>data</code></dt><dd><p>A data frame with at least the columns name, time
+and value in order to be compatible with mkinfit</p></dd>
+</dl><p></div></p>
<h2 class="hasAnchor" id="methods"><a class="anchor" href="#methods"></a>Methods</h2>
@@ -174,10 +177,20 @@ value in order to be compatible with mkinfit</p></dd>
</ul>
<p><hr>
<a id="method-new"></a></p><h3>Method <code>new()</code></h3>
-
-<h3>Usage</h3>
+<p>Create a new mkinds object</p><h3>Usage</h3>
<p><div class="r"></p><pre>mkinds$new(title = "", data, time_unit = NA, unit = NA)</pre><p></div></p>
+<h3>Arguments</h3>
+<p><div class="arguments"></p><dl class='dl-horizontal'>
+<dt><code>title</code></dt><dd><p>The dataset title</p></dd>
+
+<dt><code>data</code></dt><dd><p>The data</p></dd>
+
+<dt><code>time_unit</code></dt><dd><p>The time unit</p></dd>
+
+<dt><code>unit</code></dt><dd><p>The unit of the observations</p></dd>
+
+</dl><p></div></p>
<p><hr>
<a id="method-clone"></a></p><h3>Method <code>clone()</code></h3>
<p>The objects of this class are cloneable with this method.</p><h3>Usage</h3>
@@ -193,13 +206,18 @@ value in order to be compatible with mkinfit</p></dd>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'>
-<span class='no'>mds</span> <span class='kw'>&lt;-</span> <span class='no'>mkinds</span>$<span class='fu'>new</span>(<span class='st'>"FOCUS A"</span>, <span class='no'>FOCUS_2006_A</span>)</div></pre>
+<span class='no'>mds</span> <span class='kw'>&lt;-</span> <span class='no'>mkinds</span>$<span class='fu'>new</span>(<span class='st'>"FOCUS A"</span>, <span class='no'>FOCUS_2006_A</span>)
+<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>mds</span>)</div><div class='output co'>#&gt; &lt;mkinds&gt; with $title: FOCUS A
+#&gt; Observed compounds $observed: parent
+#&gt; Sampling times $sampling_times: 0, 3, 7, 14, 30, 62, 90, 118
+#&gt; With a maximum of 1 replicates</div><div class='input'>
+</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
- <li><a href="#format">Format</a></li>
- <li><a href="#fields">Fields</a></li>
+ <li><a href="#see-also">See also</a></li>
+ <li><a href="#public-fields">Public fields</a></li>
<li><a href="#methods">Methods</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
diff --git a/docs/reference/print.mkinds.html b/docs/reference/print.mkinds.html
index d7ba94e1..de1a2410 100644
--- a/docs/reference/print.mkinds.html
+++ b/docs/reference/print.mkinds.html
@@ -36,7 +36,7 @@
<meta property="og:title" content="Print mkinds objects — print.mkinds" />
-<meta property="og:description" content="Print mkinds objects." />
+<meta property="og:description" content="Print mkinds objects" />
<meta name="twitter:card" content="summary" />
@@ -69,7 +69,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mkin</a>
- <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.49.6</span>
+ <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.49.9</span>
</span>
</div>
@@ -133,7 +133,7 @@
</div>
<div class="ref-description">
- <p>Print mkinds objects.</p>
+ <p>Print mkinds objects</p>
</div>
<pre class="usage"><span class='co'># S3 method for mkinds</span>
diff --git a/man/mkinds.Rd b/man/mkinds.Rd
index 79eb0167..3bbb1c4b 100644
--- a/man/mkinds.Rd
+++ b/man/mkinds.Rd
@@ -1,38 +1,43 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mkinds.R
-\docType{class}
\name{mkinds}
\alias{mkinds}
\title{A dataset class for mkin}
-\format{An \code{\link{R6Class}} generator object.}
\description{
-A dataset class for mkin
+At the moment this dataset class is hardly used in mkin. For example,
+mkinfit does not take mkinds datasets as argument, but works with dataframes
+such as the on contained in the data field of mkinds objects. Some datasets
+provided by this package come as mkinds objects nevertheless.
}
-\section{Fields}{
+\examples{
+mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
+print(mds)
-\describe{ \item{list("title")}{A full title for the dataset}
+}
+\seealso{
+The S3 printing method \code{\link{print.mkinds}}
+}
+\section{Public fields}{
+\if{html}{\out{<div class="r6-fields">}}
+\describe{
+\item{\code{title}}{A full title for the dataset}
-\item{list("sampling")}{times The sampling times}
+\item{\code{sampling_times}}{The sampling times}
-\item{list("time_unit")}{The time unit}
+\item{\code{time_unit}}{The time unit}
-\item{list("observed")}{Names of the observed compounds}
+\item{\code{observed}}{Names of the observed variables}
-\item{list("unit")}{The unit of the observations}
+\item{\code{unit}}{The unit of the observations}
-\item{list("replicates")}{The number of replicates}
+\item{\code{replicates}}{The maximum number of replicates per sampling time}
-\item{list("data")}{A dataframe with at least the columns name, time and
-value in order to be compatible with mkinfit} }
+\item{\code{data}}{A data frame with at least the columns name, time
+and value in order to be compatible with mkinfit}
}
-
-\examples{
-
-mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
-
+\if{html}{\out{</div>}}
}
-\keyword{datasets}
\section{Methods}{
\subsection{Public methods}{
\itemize{
@@ -43,10 +48,24 @@ mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\subsection{Method \code{new()}}{
+Create a new mkinds object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{mkinds$new(title = "", data, time_unit = NA, unit = NA)}\if{html}{\out{</div>}}
}
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{title}}{The dataset title}
+
+\item{\code{data}}{The data}
+
+\item{\code{time_unit}}{The time unit}
+
+\item{\code{unit}}{The unit of the observations}
+}
+\if{html}{\out{</div>}}
+}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-clone"></a>}}
diff --git a/man/print.mkinds.Rd b/man/print.mkinds.Rd
index 54dc5a12..51ef3b76 100644
--- a/man/print.mkinds.Rd
+++ b/man/print.mkinds.Rd
@@ -12,5 +12,5 @@
\item{\dots}{Not used.}
}
\description{
-Print mkinds objects.
+Print mkinds objects
}
diff --git a/test.log b/test.log
index 2db18301..77130814 100644
--- a/test.log
+++ b/test.log
@@ -2,52 +2,37 @@ Loading mkin
Testing mkin
✔ | OK F W S | Context
✔ | 2 | Export dataset for reading into CAKE
-✔ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [3.8 s]
+✔ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [3.7 s]
✔ | 4 | Calculation of FOCUS chi2 error levels [2.3 s]
-✔ | 4 | Fitting the SFORB model [1.7 s]
+✔ | 4 | Fitting the SFORB model [1.8 s]
✔ | 5 | Calculation of Akaike weights
-✔ | 10 | Confidence intervals and p-values [10.2 s]
-✔ | 14 | Error model fitting [40.7 s]
+✔ | 10 | Confidence intervals and p-values [10.7 s]
+✔ | 14 | Error model fitting [42.8 s]
✔ | 6 | Test fitting the decline of metabolites from their maximum [0.8 s]
✔ | 1 | Fitting the logistic model [1.0 s]
✔ | 1 | Test dataset class mkinds used in gmkin
-✖ | 11 1 | Special cases of mkinfit calls [2.3 s]
-────────────────────────────────────────────────────────────────────────────────
-test_mkinfit_errors.R:64: failure: We get reproducible output if quiet = FALSE
-Results have changed from known value recorded in 'DFOP_FOCUS_C_messages.txt'.
-2/165 mismatches
-x[84]: "Sum of squared residuals at call 57: 4.364077"
-y[84]: "Sum of squared residuals at call 57: 4.364078"
-
-x[105]: "85.00134 -0.7776046 -4.025878 1.248775 "
-y[105]: "85.00135 -0.7776046 -4.025878 1.248775 "
-────────────────────────────────────────────────────────────────────────────────
+✔ | 12 | Special cases of mkinfit calls [2.5 s]
✔ | 9 | mkinmod model generation and printing [0.2 s]
-✔ | 3 | Model predictions with mkinpredict [0.3 s]
-✔ | 16 | Evaluations according to 2015 NAFTA guidance [4.3 s]
-✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2 s]
+✔ | 3 | Model predictions with mkinpredict [0.4 s]
+✔ | 16 | Evaluations according to 2015 NAFTA guidance [4.4 s]
+✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.3 s]
✔ | 3 | Summary
-✖ | 10 1 | Plotting [0.6 s]
-────────────────────────────────────────────────────────────────────────────────
-test_plots_summary_twa.R:118: failure: Plotting mkinfit and mmkin objects is reproducible
-Figures don't match: plot-errmod-with-sfo-lin-a-obs.svg
-
-────────────────────────────────────────────────────────────────────────────────
+✔ | 11 | Plotting [0.6 s]
✔ | 4 | AIC calculation
✔ | 2 | Residuals extracted from mkinfit models
-✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.6 s]
+✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.7 s]
✔ | 1 | Summaries of old mkinfit objects
-✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.4 s]
-✔ | 7 1 | Hypothesis tests [33.6 s]
+✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.7 s]
+✔ | 7 1 | Hypothesis tests [35.7 s]
────────────────────────────────────────────────────────────────────────────────
test_tests.R:60: skip: We can do a likelihood ratio test using an update specification
Reason: This errors out if called by testthat while it works in a normal R session
────────────────────────────────────────────────────────────────────────────────
══ Results ═════════════════════════════════════════════════════════════════════
-Duration: 117.3 s
+Duration: 123.0 s
-OK: 136
-Failed: 2
+OK: 138
+Failed: 0
Warnings: 0
Skipped: 1

Contact - Imprint