summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DESCRIPTION2
-rw-r--r--R/twa.R7
-rw-r--r--README.md6
-rw-r--r--pfm.Rproj1
4 files changed, 11 insertions, 5 deletions
diff --git a/DESCRIPTION b/DESCRIPTION
index a51e404..3e64e31 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -32,6 +32,6 @@ License: GPL
LazyLoad: true
LazyData: true
Encoding: UTF-8
-URL: https://pkgdown.jrwb.de/pfm, https://github.com/jranke/pfm
+URL: https://pkgdown.jrwb.de/pfm, https://github.com/jranke/pfm, http://jranke.github.io/pfm/
Roxygen: list(markdown = TRUE, r6 = TRUE)
RoxygenNote: 7.3.2.9000
diff --git a/R/twa.R b/R/twa.R
index 886351d..2018dfa 100644
--- a/R/twa.R
+++ b/R/twa.R
@@ -131,6 +131,7 @@ one_box.mkinfit <- function(x, ini = "model", ..., t_end = 100, res = 0.01) {
#' fit_2 <- mkinfit(m_2, FOCUS_2006_D, quiet = TRUE)
#' pred_2 <- one_box(fit_2, ini = 1)
#' pred_2_saw <- sawtooth(pred_2, 2, 7)
+#' plot(pred_2_saw)
#' plot(pred_2_saw, max_twa = 21, max_twa_var = "m1")
plot.one_box <- function(x,
xlim = range(time(x)), ylim = c(0, max(x)),
@@ -148,7 +149,9 @@ plot.one_box <- function(x,
x_twa$window_end[max_twa_var], value, col = "grey")
text(x_twa$window_end[max_twa_var], value, paste("Maximum:", signif(value, 3)), pos = 4)
# Plot a second time to cover the grey rectangle
- matlines(time(x), as.matrix(x), lty = 1:length(obs_vars), col = 1:length(obs_vars))
+ plot.ts(x, plot.type = "single", xlab = xlab, ylab = ylab,
+ lty = 1:length(obs_vars), col = 1:length(obs_vars),
+ las = 1, xlim = xlim, ylim = ylim)
}
}
@@ -229,7 +232,7 @@ twa.one_box <- function(x, window = 21)
resolution = 1/frequency(x)
n_filter = window/resolution
- result = filter(x, rep(1/n_filter, n_filter), method = "convolution", sides = 1)
+ result = stats::filter(x, rep(1/n_filter, n_filter), method = "convolution", sides = 1)
class(result) = c("one_box", "ts")
dimnames(result) <- dimnames(x)
return(result)
diff --git a/README.md b/README.md
index 8b3e423..ac78192 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,8 @@
[![codecov](https://codecov.io/github/jranke/pfm/branch/main/graphs/badge.svg)](https://codecov.io/github/jranke/pfm)
The R package **pfm** provides some utilities for fate modelling, including
-dealing with FOCUS pesticide fate modelling tools, (currently only TOXSWA cwa
+simple PEC calculation routines and some routines for
+dealing with FOCUS pesticide fate modelling tools (currently only TOXSWA cwa
and out files), made available under the GNU public license.
## Installation
@@ -15,7 +16,8 @@ The easiest way to install the package is probably to use the
[r-universe repo](https://jranke.r-universe.dev/pfm):
```r
-install.packages("pfm", repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org"))
+install.packages("pfm",
+ repos = c("https://jranke.r-universe.dev", "https://cran.r-project.org"))
```
The packages at R-universe are provided with a slight delay. Alternatively, you
diff --git a/pfm.Rproj b/pfm.Rproj
index 8de5cfd..0fe08c5 100644
--- a/pfm.Rproj
+++ b/pfm.Rproj
@@ -1,4 +1,5 @@
Version: 1.0
+ProjectId: 3fe3eae4-f182-4b74-88d9-017fe88380f0
RestoreWorkspace: Default
SaveWorkspace: Default

Contact - Imprint