aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-07-23 10:51:39 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-07-23 10:51:39 +0200
commit90fa42c86596c85168931148bf8d5fa014fa7794 (patch)
tree3545ec8a4842a3760c199e3d4999702f133c0c37
parentdf70d80d9ef13b69e58de6f47b9041b6a021025e (diff)
Update docs, use R6 support of roxygen
-rw-r--r--ChangeLog6
-rw-r--r--DESCRIPTION8
-rw-r--r--NAMESPACE1
-rw-r--r--R/GUS.R1
-rw-r--r--R/TOXSWA_cwa.R56
-rw-r--r--R/drift_data_JKI.R4
-rw-r--r--R/endpoint.R4
-rw-r--r--_pkgdown.yml3
-rw-r--r--docs/pkgdown.yml2
-rw-r--r--docs/reference/TOXSWA_cwa.html82
-rw-r--r--docs/reference/index.html19
-rw-r--r--docs/reference/pfm_degradation.html52
-rw-r--r--docs/reference/sawtooth-2.pngbin37285 -> 42340 bytes
-rw-r--r--docs/reference/sawtooth.html46
-rw-r--r--man/TOXSWA_cwa.Rd76
15 files changed, 225 insertions, 135 deletions
diff --git a/ChangeLog b/ChangeLog
index acad9ae..58e9249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+commit df70d80d9ef13b69e58de6f47b9041b6a021025e
+Author: Johannes Ranke <jranke@uni-bremen.de>
+Date: 2020-07-21 15:50:21 +0200
+
+ Clean test.log after testing
+
commit 512cd50874b060d50a14d28df88018ac144cf6d3
Author: Johannes Ranke <jranke@uni-bremen.de>
Date: 2020-07-07 12:36:56 +0200
diff --git a/DESCRIPTION b/DESCRIPTION
index e877629..ef5c7a9 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: pfm
Type: Package
Title: Utilities for Pesticide Fate Modelling
-Version: 0.5.7
-Date: 2020-07-07
+Version: 0.5.8
+Date: 2020-07-23
Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de",
role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0003-4371-6538"))
@@ -31,5 +31,5 @@ License: GPL
LazyLoad: yes
LazyData: yes
Encoding: UTF-8
-URL: https://pkdown.jrwb.de/pfm
-RoxygenNote: 7.1.0
+URL: https://pkgdown.jrwb.de/pfm
+RoxygenNote: 7.1.1
diff --git a/NAMESPACE b/NAMESPACE
index e24d712..8b44855 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -46,7 +46,6 @@ export(soil_sorption)
export(twa)
import(graphics)
import(mkin)
-importFrom(R6,R6Class)
importFrom(grDevices,dev.cur)
importFrom(methods,is)
importFrom(mkin,mkinpredict)
diff --git a/R/GUS.R b/R/GUS.R
index 040857a..32f371c 100644
--- a/R/GUS.R
+++ b/R/GUS.R
@@ -7,7 +7,6 @@
#' @references Gustafson, David I. (1989) Groundwater ubiquity score: a simple
#' method for assessing pesticide leachability. \emph{Environmental
#' toxicology and chemistry} \bold{8}(4) 339–57.
-#' @inheritParams endpoint
#' @param DT50 Half-life of the chemical in soil. Should be a field
#' half-life according to Gustafson (1989). However, leaching to the sub-soil
#' can not completely be excluded in field dissipation experiments and Gustafson
diff --git a/R/TOXSWA_cwa.R b/R/TOXSWA_cwa.R
index 42cdd35..6521349 100644
--- a/R/TOXSWA_cwa.R
+++ b/R/TOXSWA_cwa.R
@@ -142,35 +142,24 @@ plot.TOXSWA_cwa <- function(x, time_column = c("datetime", "t", "t_firstjan", "t
#' R6 class for holding TOXSWA water concentration data and associated statistics
#'
-#' An R6 class for holding TOXSWA water concentration (cwa) data and some associated statistics.
-#' Usually, an instance of this class will be generated by \code{\link{read.TOXSWA_cwa}}.
+#' @description An R6 class for holding TOXSWA water concentration (cwa) data
+#' and some associated statistics. like maximum moving window average
+#' concentrations, and dataframes holding the events exceeding specified
+#' thresholds. Usually, an instance of this class will be generated
+#' by \code{\link{read.TOXSWA_cwa}}.
#'
-#' @docType class
-#' @importFrom R6 R6Class
#' @export
#' @format An \code{\link{R6Class}} generator object.
-#' @field filename Length one character vector.
-#' @field basedir Length one character vector.
+#' @field filename Length one character vector holding the filename.
+#' @field basedir Length one character vector holding the directory where the file came from.
+#' @field zipfile If not null, giving the path to the zip file from which the file was read.
#' @field segment Length one integer, specifying for which segment the cwa data were read.
+#' @field substance The TOXSWA name of the substance.
#' @field cwas Dataframe holding the concentrations.
#' @field events List of dataframes holding the event statistics for each threshold.
#' @field windows Matrix of maximum time weighted average concentrations (TWAC_max)
#' and areas under the curve in µg/day * h (AUC_max_h) or µg/day * d (AUC_max_d)
#' for the requested moving window sizes in days.
-#' @section Methods:
-#' \describe{
-#' \item{\code{get_events(threshold, total = FALSE)}}{
-#' Populate a datataframe with event information for the specified threshold value
-#' in µg/L. If \code{total = TRUE}, the total concentration including the amount
-#' adsorbed to suspended matter will be used. The resulting dataframe is stored in the
-#' \code{events} field of the object.
-#' }
-#' \item{\code{moving_windows(windows, total = FALSE)}}{
-#' Add to the \code{windows} field described above.
-#' Again, if \code{total = TRUE}, the total concentration including the amount
-#' adsorbed to suspended matter will be used.
-#' }
-#' }
#' @examples
#' H_sw_R1_stream <- read.TOXSWA_cwa("00003s_pa.cwa",
#' basedir = "SwashProjects/project_H_sw/TOXSWA",
@@ -180,7 +169,6 @@ plot.TOXSWA_cwa <- function(x, time_column = c("datetime", "t", "t_firstjan", "t
#' H_sw_R1_stream$moving_windows(c(7, 21))
#' print(H_sw_R1_stream)
#' @keywords data
-
TOXSWA_cwa <- R6Class("TOXSWA_cwa",
public = list(
filename = NULL,
@@ -191,6 +179,15 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
cwas = NULL,
windows = NULL,
events = list(),
+
+ #' @description
+ #' Create a TOXSWA_cwa object from a file
+ #' @param filename The filename
+ #' @param basedir The directory to look in
+ #' @param zipfile Optional path to a zipfile holding the file
+ #' @param segment Either "last" or the number of the segment for which to read the data
+ #' @param substance The TOXSWA substance name (for TOXSWA 4 or higher)
+ #' @param total Should total concentrations be read in? If FALSE, free concentrations are read
initialize = function(filename, basedir, zipfile = NULL,
segment = "last", substance = "parent", total = FALSE) {
self$filename <- filename
@@ -327,6 +324,12 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
}
}
},
+
+ #' @description
+ #' Add to the `windows` field described above.
+ #' @param windows Window sizes in days
+ #' @param total If TRUE, the total concentration including the amount adsorbed to
+ #' suspended matter will be used.
moving_windows = function(windows, total = FALSE) {
window_names = paste(windows, "days")
n = length(window_names)
@@ -350,6 +353,14 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
}
invisible(self)
},
+
+ #' @description
+ #' Populate a datataframe with event information for the specified
+ #' threshold value. The resulting dataframe is stored in the `events`
+ #' field of the object.
+ #' @param thresholds Threshold values in µg/L.
+ #' @param total If TRUE, the total concentration including the amount adsorbed to
+ #' suspended matter will be used.
get_events = function(thresholds, total = FALSE) {
if (missing(thresholds)) {
stop("You need to specify at least one threshold concentration in \u03bcg/L")
@@ -397,6 +408,9 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
}
invisible(self)
},
+
+ #' @description
+ #' Print a `TOXSWA_cwa` object
print = function() {
cat("<TOXSWA_cwa> data from file", self$filename, "segment", self$segment, "\n")
print(head(self$cwas))
diff --git a/R/drift_data_JKI.R b/R/drift_data_JKI.R
index e44079d..3b02f43 100644
--- a/R/drift_data_JKI.R
+++ b/R/drift_data_JKI.R
@@ -30,7 +30,7 @@
#' from
#' http://www.jki.bund.de/no_cache/de/startseite/institute/anwendungstechnik/abdrift-eckwerte.html
#' on 2015-06-11
-#'
+#'
#' Rautmann, D., Streloke, M and Winkler, R (2001) New basic drift values in
#' the authorization procedure for plant protection products Mitt. Biol.
#' Bundesanst. Land- Forstwirtsch. 383, 133-141
@@ -82,6 +82,6 @@
#' save(drift_data_JKI, file = "data/drift_data_JKI.RData")
#' }
#'
-#' # And this is the resulting data
+#' # And these are the resulting data
#' drift_data_JKI
NULL
diff --git a/R/endpoint.R b/R/endpoint.R
index 56a314b..08856f9 100644
--- a/R/endpoint.R
+++ b/R/endpoint.R
@@ -55,7 +55,6 @@ endpoint <- function(chent,
else return(signif(aggregator(as.numeric(values)), signif))
}
-#' @inheritParams endpoint
#' @rdname endpoint
#' @export
soil_DT50 <- function(chent, aggregator = geomean, signif = 3,
@@ -68,7 +67,6 @@ soil_DT50 <- function(chent, aggregator = geomean, signif = 3,
return(ep)
}
-#' @inheritParams endpoint
#' @rdname endpoint
#' @export
soil_Kfoc <- function(chent, aggregator = geomean, signif = 3,
@@ -79,7 +77,6 @@ soil_Kfoc <- function(chent, aggregator = geomean, signif = 3,
return(ep)
}
-#' @inheritParams endpoint
#' @rdname endpoint
#' @export
soil_N <- function(chent, aggregator = mean, signif = 3, raw = FALSE) {
@@ -89,7 +86,6 @@ soil_N <- function(chent, aggregator = mean, signif = 3, raw = FALSE) {
return(ep)
}
-#' @inheritParams endpoint
#' @rdname endpoint
#' @param values The values to be returned
#' @param aggregators A named vector of aggregator functions to be used
diff --git a/_pkgdown.yml b/_pkgdown.yml
index 71f3c65..4f12b7c 100644
--- a/_pkgdown.yml
+++ b/_pkgdown.yml
@@ -53,6 +53,9 @@ reference:
contents:
- SSLRC_mobility_classification
- GUS
+ - title: Work with chent objects containing relevant information
+ contents:
+ - endpoint
- title: Utilities
contents:
- get_vertex
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 077f218..8b86fe9 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -2,7 +2,7 @@ pandoc: 2.2.1
pkgdown: 1.5.1
pkgdown_sha: ~
articles: []
-last_built: 2020-06-17T11:36Z
+last_built: 2020-07-22T15:06Z
urls:
reference: https://pkgdown.jrwb.de/pfm/reference
article: https://pkgdown.jrwb.de/pfm/articles
diff --git a/docs/reference/TOXSWA_cwa.html b/docs/reference/TOXSWA_cwa.html
index 9f9e3c3..16dc5db 100644
--- a/docs/reference/TOXSWA_cwa.html
+++ b/docs/reference/TOXSWA_cwa.html
@@ -40,8 +40,11 @@
<meta property="og:title" content="R6 class for holding TOXSWA water concentration data and associated statistics — TOXSWA_cwa" />
-<meta property="og:description" content="An R6 class for holding TOXSWA water concentration (cwa) data and some associated statistics.
-Usually, an instance of this class will be generated by read.TOXSWA_cwa." />
+<meta property="og:description" content="An R6 class for holding TOXSWA water concentration (cwa) data
+and some associated statistics. like maximum moving window average
+concentrations, and dataframes holding the events exceeding specified
+thresholds. Usually, an instance of this class will be generated
+by read.TOXSWA_cwa." />
@@ -110,8 +113,11 @@ Usually, an instance of this class will be generated by read.TOXSWA_cwa." />
</div>
<div class="ref-description">
- <p>An R6 class for holding TOXSWA water concentration (cwa) data and some associated statistics.
-Usually, an instance of this class will be generated by <code><a href='read.TOXSWA_cwa.html'>read.TOXSWA_cwa</a></code>.</p>
+ <p>An R6 class for holding TOXSWA water concentration (cwa) data
+and some associated statistics. like maximum moving window average
+concentrations, and dataframes holding the events exceeding specified
+thresholds. Usually, an instance of this class will be generated
+by <code><a href='read.TOXSWA_cwa.html'>read.TOXSWA_cwa</a></code>.</p>
</div>
@@ -119,30 +125,19 @@ Usually, an instance of this class will be generated by <code><a href='read.TOXS
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>An <code>R6Class</code> generator object.</p>
- <h2 class="hasAnchor" id="methods"><a class="anchor" href="#methods"></a>Methods</h2>
-
-
-
-<dl'>
- <dt><code>get_events(threshold, total = FALSE)</code></dt><dd><p>Populate a datataframe with event information for the specified threshold value
- in µg/L. If <code>total = TRUE</code>, the total concentration including the amount
- adsorbed to suspended matter will be used. The resulting dataframe is stored in the
- <code>events</code> field of the object.</p></dd>
- <dt><code>moving_windows(windows, total = FALSE)</code></dt><dd><p>Add to the <code>windows</code> field described above.
- Again, if <code>total = TRUE</code>, the total concentration including the amount
- adsorbed to suspended matter will be used.</p></dd>
-
-</dl>
-
<h2 class="hasAnchor" id="public-fields"><a class="anchor" href="#public-fields"></a>Public fields</h2>
<p><div class="r6-fields"></p><dl'>
-<dt><code>filename</code></dt><dd><p>Length one character vector.</p></dd>
+<dt><code>filename</code></dt><dd><p>Length one character vector holding the filename.</p></dd>
-<dt><code>basedir</code></dt><dd><p>Length one character vector.</p></dd>
+<dt><code>basedir</code></dt><dd><p>Length one character vector holding the directory where the file came from.</p></dd>
+
+<dt><code>zipfile</code></dt><dd><p>If not null, giving the path to the zip file from which the file was read.</p></dd>
<dt><code>segment</code></dt><dd><p>Length one integer, specifying for which segment the cwa data were read.</p></dd>
+<dt><code>substance</code></dt><dd><p>The TOXSWA name of the substance.</p></dd>
+
<dt><code>cwas</code></dt><dd><p>Dataframe holding the concentrations.</p></dd>
<dt><code>events</code></dt><dd><p>List of dataframes holding the event statistics for each threshold.</p></dd>
@@ -166,8 +161,7 @@ for the requested moving window sizes in days.</p></dd>
</ul>
<p><hr>
<a id="method-new"></a></p><h3>Method <code>new()</code></h3>
-
-<h3>Usage</h3>
+<p>Create a TOXSWA_cwa object from a file</p><h3>Usage</h3>
<p><div class="r"></p><pre><span class='no'>TOXSWA_cwa</span>$<span class='fu'>new</span>(
<span class='no'>filename</span>,
<span class='no'>basedir</span>,
@@ -177,22 +171,52 @@ for the requested moving window sizes in days.</p></dd>
<span class='kw'>total</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
)</pre><p></div></p>
+<h3>Arguments</h3>
+<p><div class="arguments"></p><dl'>
+<dt><code>filename</code></dt><dd><p>The filename</p></dd>
+
+<dt><code>basedir</code></dt><dd><p>The directory to look in</p></dd>
+
+<dt><code>zipfile</code></dt><dd><p>Optional path to a zipfile holding the file</p></dd>
+
+<dt><code>segment</code></dt><dd><p>Either "last" or the number of the segment for which to read the data</p></dd>
+
+<dt><code>substance</code></dt><dd><p>The TOXSWA substance name (for TOXSWA 4 or higher)</p></dd>
+
+<dt><code>total</code></dt><dd><p>Should total concentrations be read in? If FALSE, free concentrations are read</p></dd>
+
+</dl><p></div></p>
<p><hr>
<a id="method-moving_windows"></a></p><h3>Method <code>moving_windows()</code></h3>
-
-<h3>Usage</h3>
+<p>Add to the `windows` field described above.</p><h3>Usage</h3>
<p><div class="r"></p><pre><span class='no'>TOXSWA_cwa</span>$<span class='fu'>moving_windows</span>(<span class='no'>windows</span>, <span class='kw'>total</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre><p></div></p>
+<h3>Arguments</h3>
+<p><div class="arguments"></p><dl'>
+<dt><code>windows</code></dt><dd><p>Window sizes in days</p></dd>
+
+<dt><code>total</code></dt><dd><p>If TRUE, the total concentration including the amount adsorbed to
+suspended matter will be used.</p></dd>
+
+</dl><p></div></p>
<p><hr>
<a id="method-get_events"></a></p><h3>Method <code>get_events()</code></h3>
-
-<h3>Usage</h3>
+<p>Populate a datataframe with event information for the specified
+threshold value. The resulting dataframe is stored in the `events`
+field of the object.</p><h3>Usage</h3>
<p><div class="r"></p><pre><span class='no'>TOXSWA_cwa</span>$<span class='fu'>get_events</span>(<span class='no'>thresholds</span>, <span class='kw'>total</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre><p></div></p>
+<h3>Arguments</h3>
+<p><div class="arguments"></p><dl'>
+<dt><code>thresholds</code></dt><dd><p>Threshold values in µg/L.</p></dd>
+
+<dt><code>total</code></dt><dd><p>If TRUE, the total concentration including the amount adsorbed to
+suspended matter will be used.</p></dd>
+
+</dl><p></div></p>
<p><hr>
<a id="method-print"></a></p><h3>Method <code><a href='https://rdrr.io/r/base/print.html'>print()</a></code></h3>
-
-<h3>Usage</h3>
+<p>Print a `TOXSWA_cwa` object</p><h3>Usage</h3>
<p><div class="r"></p><pre><span class='no'>TOXSWA_cwa</span>$<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>()</pre><p></div></p>
<p><hr>
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 944f1f2..186390e 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -393,6 +393,25 @@ water concentrations</p></td>
</tbody><tbody>
<tr>
<th colspan="2">
+ <h2 id="section-work-with-chent-objects-containing-relevant-information" class="hasAnchor"><a href="#section-work-with-chent-objects-containing-relevant-information" class="anchor"></a>Work with chent objects containing relevant information</h2>
+ <p class="section-desc"></p>
+ </th>
+ </tr>
+
+
+ </tbody><tbody>
+
+
+ <tr>
+
+ <td>
+ <p><code><a href="endpoint.html">endpoint()</a></code> <code><a href="endpoint.html">soil_DT50()</a></code> <code><a href="endpoint.html">soil_Kfoc()</a></code> <code><a href="endpoint.html">soil_N()</a></code> <code><a href="endpoint.html">soil_sorption()</a></code> </p>
+ </td>
+ <td><p>Retrieve endpoint information from the chyaml field of a chent object</p></td>
+ </tr>
+ </tbody><tbody>
+ <tr>
+ <th colspan="2">
<h2 id="section-utilities" class="hasAnchor"><a href="#section-utilities" class="anchor"></a>Utilities</h2>
<p class="section-desc"></p>
</th>
diff --git a/docs/reference/pfm_degradation.html b/docs/reference/pfm_degradation.html
index d2e62f6..8d06107 100644
--- a/docs/reference/pfm_degradation.html
+++ b/docs/reference/pfm_degradation.html
@@ -10,23 +10,27 @@
<!-- jquery -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />
-<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
+
+<!-- bootstrap-toc -->
+<link rel="stylesheet" href="../bootstrap-toc.css">
+<script src="../bootstrap-toc.js"></script>
<!-- Font Awesome icons -->
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous" />
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />
<!-- clipboard.js -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<!-- headroom.js -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
@@ -37,7 +41,6 @@
<meta property="og:title" content="Calculate a time course of relative concentrations based on an mkinmod model — pfm_degradation" />
<meta property="og:description" content="Calculate a time course of relative concentrations based on an mkinmod model" />
-<meta name="twitter:card" content="summary" />
@@ -55,7 +58,7 @@
</head>
- <body>
+ <body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
@@ -112,7 +115,7 @@
<pre class="usage"><span class='fu'>pfm_degradation</span>(
<span class='kw'>model</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>,
<span class='kw'>DT50</span> <span class='kw'>=</span> <span class='fl'>1000</span>,
- <span class='kw'>parms</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span>(<span class='fl'>2</span>)/<span class='no'>DT50</span>),
+ <span class='kw'>parms</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k_parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span>(<span class='fl'>2</span>)/<span class='no'>DT50</span>),
<span class='kw'>years</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>step_days</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>times</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='no'>years</span> * <span class='fl'>365</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='no'>step_days</span>)
@@ -152,22 +155,17 @@ is calculated (SFO model).</p></td>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/head.html'>head</a></span>(<span class='fu'>pfm_degradation</span>(<span class='st'>"SFO"</span>, <span class='kw'>DT50</span> <span class='kw'>=</span> <span class='fl'>10</span>))</div><div class='output co'>#&gt; time parent
-#&gt; 1 0 1.0000000
-#&gt; 2 1 0.9330330
-#&gt; 3 2 0.8705506
-#&gt; 4 3 0.8122524
-#&gt; 5 4 0.7578583
-#&gt; 6 5 0.7071068</div></pre>
+#&gt; 0 0 1.0000000
+#&gt; 1 1 0.9330330
+#&gt; 2 2 0.8705506
+#&gt; 3 3 0.8122524
+#&gt; 4 4 0.7578583
+#&gt; 5 5 0.7071068</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="#arguments">Arguments</a></li>
- <li><a href="#examples">Examples</a></li>
- </ul>
-
- <h2>Author</h2>
- <p>Johannes Ranke</p>
+ <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
+ <nav id="toc" data-toggle="toc" class="sticky-top">
+ <h2 data-toc-skip>Contents</h2>
+ </nav>
</div>
</div>
@@ -178,7 +176,7 @@ is calculated (SFO model).</p></td>
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
</div>
</footer>
diff --git a/docs/reference/sawtooth-2.png b/docs/reference/sawtooth-2.png
index ad93165..87da954 100644
--- a/docs/reference/sawtooth-2.png
+++ b/docs/reference/sawtooth-2.png
Binary files differ
diff --git a/docs/reference/sawtooth.html b/docs/reference/sawtooth.html
index 7720afc..fea24d4 100644
--- a/docs/reference/sawtooth.html
+++ b/docs/reference/sawtooth.html
@@ -10,23 +10,27 @@
<!-- jquery -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />
-<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
+
+<!-- bootstrap-toc -->
+<link rel="stylesheet" href="../bootstrap-toc.css">
+<script src="../bootstrap-toc.js"></script>
<!-- Font Awesome icons -->
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous" />
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />
<!-- clipboard.js -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<!-- headroom.js -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
@@ -36,9 +40,8 @@
<meta property="og:title" content="Create decline time series for multiple applications — sawtooth" />
-<meta property="og:description" content="If the application pattern is specified in applications,
+<meta property="og:description" content="If the application pattern is specified in applications,
n and i are disregarded." />
-<meta name="twitter:card" content="summary" />
@@ -56,7 +59,7 @@ n and i are disregarded." />
</head>
- <body>
+ <body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
@@ -107,7 +110,7 @@ n and i are disregarded." />
</div>
<div class="ref-description">
- <p>If the application pattern is specified in <code>applications</code>,
+ <p>If the application pattern is specified in <code>applications</code>,
<code>n</code> and <code>i</code> are disregarded.</p>
</div>
@@ -145,10 +148,10 @@ the corresponding amounts applied in the second column.</p></td>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='no'>applications</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span>(<span class='kw'>time</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>14</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>7</span>), <span class='kw'>amount</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>1</span>, <span class='fl'>2</span>, <span class='fl'>3</span>))
<span class='no'>pred</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='one_box.html'>one_box</a></span>(<span class='fl'>10</span>)
-<span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='fu'>sawtooth</span>(<span class='no'>pred</span>, <span class='kw'>applications</span> <span class='kw'>=</span> <span class='no'>applications</span>))</div><div class='img'><img src='sawtooth-1.png' alt='' width='700' height='433' /></div><div class='input'>
-<span class='no'>m_2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output co'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>fit_2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>m_2</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='no'>pred_2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='one_box.html'>one_box</a></span>(<span class='no'>fit_2</span>, <span class='kw'>ini</span> <span class='kw'>=</span> <span class='fl'>1</span>)
+<span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='fu'>sawtooth</span>(<span class='no'>pred</span>, <span class='kw'>applications</span> <span class='kw'>=</span> <span class='no'>applications</span>))</div><div class='img'><img src='sawtooth-1.png' alt='' width='700' height='433' /></div><div class='input'>
+<span class='no'>m_2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output co'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>fit_2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>m_2</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='no'>pred_2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='one_box.html'>one_box</a></span>(<span class='no'>fit_2</span>, <span class='kw'>ini</span> <span class='kw'>=</span> <span class='fl'>1</span>)
<span class='no'>pred_2_saw</span> <span class='kw'>&lt;-</span> <span class='fu'>sawtooth</span>(<span class='no'>pred_2</span>, <span class='fl'>2</span>, <span class='fl'>7</span>)
-<span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='no'>pred_2_saw</span>, <span class='kw'>max_twa</span> <span class='kw'>=</span> <span class='fl'>21</span>, <span class='kw'>max_twa_var</span> <span class='kw'>=</span> <span class='st'>"m1"</span>)</div><div class='img'><img src='sawtooth-2.png' alt='' width='700' height='433' /></div><div class='input'>
+<span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>pred_2_saw</span>, <span class='kw'>max_twa</span> <span class='kw'>=</span> <span class='fl'>21</span>, <span class='kw'>max_twa_var</span> <span class='kw'>=</span> <span class='st'>"m1"</span>)</div><div class='img'><img src='sawtooth-2.png' alt='' width='700' height='433' /></div><div class='input'>
<span class='fu'><a href='max_twa.html'>max_twa</a></span>(<span class='no'>pred_2_saw</span>)</div><div class='output co'>#&gt; $max
#&gt; parent m1
#&gt; 0.7834480 0.8617048
@@ -162,13 +165,10 @@ the corresponding amounts applied in the second column.</p></td>
#&gt; 21.00 47.85
#&gt; </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="#arguments">Arguments</a></li>
- <li><a href="#examples">Examples</a></li>
- </ul>
-
+ <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
+ <nav id="toc" data-toggle="toc" class="sticky-top">
+ <h2 data-toc-skip>Contents</h2>
+ </nav>
</div>
</div>
@@ -179,7 +179,7 @@ the corresponding amounts applied in the second column.</p></td>
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
</div>
</footer>
diff --git a/man/TOXSWA_cwa.Rd b/man/TOXSWA_cwa.Rd
index 6a95a0b..3daa1d0 100644
--- a/man/TOXSWA_cwa.Rd
+++ b/man/TOXSWA_cwa.Rd
@@ -1,6 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/TOXSWA_cwa.R
-\docType{class}
\name{TOXSWA_cwa}
\alias{TOXSWA_cwa}
\title{R6 class for holding TOXSWA water concentration data and associated statistics}
@@ -8,26 +7,12 @@
An \code{\link{R6Class}} generator object.
}
\description{
-An R6 class for holding TOXSWA water concentration (cwa) data and some associated statistics.
-Usually, an instance of this class will be generated by \code{\link{read.TOXSWA_cwa}}.
+An R6 class for holding TOXSWA water concentration (cwa) data
+and some associated statistics. like maximum moving window average
+concentrations, and dataframes holding the events exceeding specified
+thresholds. Usually, an instance of this class will be generated
+by \code{\link{read.TOXSWA_cwa}}.
}
-\section{Methods}{
-
-\describe{
- \item{\code{get_events(threshold, total = FALSE)}}{
- Populate a datataframe with event information for the specified threshold value
- in µg/L. If \code{total = TRUE}, the total concentration including the amount
- adsorbed to suspended matter will be used. The resulting dataframe is stored in the
- \code{events} field of the object.
- }
- \item{\code{moving_windows(windows, total = FALSE)}}{
- Add to the \code{windows} field described above.
- Again, if \code{total = TRUE}, the total concentration including the amount
- adsorbed to suspended matter will be used.
- }
-}
-}
-
\examples{
H_sw_R1_stream <- read.TOXSWA_cwa("00003s_pa.cwa",
basedir = "SwashProjects/project_H_sw/TOXSWA",
@@ -41,12 +26,16 @@ print(H_sw_R1_stream)
\section{Public fields}{
\if{html}{\out{<div class="r6-fields">}}
\describe{
-\item{\code{filename}}{Length one character vector.}
+\item{\code{filename}}{Length one character vector holding the filename.}
+
+\item{\code{basedir}}{Length one character vector holding the directory where the file came from.}
-\item{\code{basedir}}{Length one character vector.}
+\item{\code{zipfile}}{If not null, giving the path to the zip file from which the file was read.}
\item{\code{segment}}{Length one integer, specifying for which segment the cwa data were read.}
+\item{\code{substance}}{The TOXSWA name of the substance.}
+
\item{\code{cwas}}{Dataframe holding the concentrations.}
\item{\code{events}}{List of dataframes holding the event statistics for each threshold.}
@@ -71,6 +60,7 @@ for the requested moving window sizes in days.}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
+Create a TOXSWA_cwa object from a file
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{TOXSWA_cwa$new(
filename,
@@ -82,29 +72,71 @@ for the requested moving window sizes in days.}
)}\if{html}{\out{</div>}}
}
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{filename}}{The filename}
+
+\item{\code{basedir}}{The directory to look in}
+
+\item{\code{zipfile}}{Optional path to a zipfile holding the file}
+
+\item{\code{segment}}{Either "last" or the number of the segment for which to read the data}
+
+\item{\code{substance}}{The TOXSWA substance name (for TOXSWA 4 or higher)}
+
+\item{\code{total}}{Should total concentrations be read in? If FALSE, free concentrations are read}
+}
+\if{html}{\out{</div>}}
+}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-moving_windows"></a>}}
\if{latex}{\out{\hypertarget{method-moving_windows}{}}}
\subsection{Method \code{moving_windows()}}{
+Add to the `windows` field described above.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{TOXSWA_cwa$moving_windows(windows, total = FALSE)}\if{html}{\out{</div>}}
}
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{windows}}{Window sizes in days}
+
+\item{\code{total}}{If TRUE, the total concentration including the amount adsorbed to
+suspended matter will be used.}
+}
+\if{html}{\out{</div>}}
+}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_events"></a>}}
\if{latex}{\out{\hypertarget{method-get_events}{}}}
\subsection{Method \code{get_events()}}{
+Populate a datataframe with event information for the specified
+threshold value. The resulting dataframe is stored in the `events`
+field of the object.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{TOXSWA_cwa$get_events(thresholds, total = FALSE)}\if{html}{\out{</div>}}
}
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{thresholds}}{Threshold values in µg/L.}
+
+\item{\code{total}}{If TRUE, the total concentration including the amount adsorbed to
+suspended matter will be used.}
+}
+\if{html}{\out{</div>}}
+}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-print"></a>}}
\if{latex}{\out{\hypertarget{method-print}{}}}
\subsection{Method \code{print()}}{
+Print a `TOXSWA_cwa` object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{TOXSWA_cwa$print()}\if{html}{\out{</div>}}
}

Contact - Imprint