From b17dc3ee5f4fda17fcbc659730cb81e447510121 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 22 Mar 2023 22:34:30 +0100 Subject: Fix typo in mkinerrmin Thanks to Sebastian Meyer for spotting it. --- NEWS.md | 2 + R/mkinerrmin.R | 2 +- log/check.log | 22 +- log/test.log | 53 ++--- man/mkinfit.Rd | 4 +- man/set_nd_nq.Rd | 4 +- .../_snaps/multistart/llhist-for-dfop-sfo-fit.svg | 4 +- ...t-for-saem-object-with-mkin-transformations.svg | 2 +- .../_snaps/multistart/parplot-for-dfop-sfo-fit.svg | 234 ++++++++++----------- .../plot/mixed-model-fit-for-nlme-object.svg | 2 +- 10 files changed, 169 insertions(+), 160 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5f173a08..65bbe185 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ - Depend on upcoming deSolve version with the possibility to avoid resolving symbols in a shared library (compiled models) over and over. +- 'R/mkinerrmin.R': Fix typo in subset (use of = instead of ==), thanks to Sebastian Meyer for spotting this during his work on R 4.3.0 + # mkin 1.2.2 (unreleased) - 'inst/rmarkdown/templates/hier': R markdown template to facilitate the application of hierarchical kinetic models. diff --git a/R/mkinerrmin.R b/R/mkinerrmin.R index 388060d4..b924f4ab 100644 --- a/R/mkinerrmin.R +++ b/R/mkinerrmin.R @@ -58,7 +58,7 @@ mkinerrmin <- function(fit, alpha = 0.05) # Remove values at time zero for variables whose value for state.ini is fixed, # as these will not have any effect in the optimization and should therefore not # be counted as degrees of freedom. - fixed_initials = gsub("_0$", "", rownames(subset(fit$fixed, type = "state"))) + fixed_initials = gsub("_0$", "", rownames(subset(fit$fixed, type == "state"))) errdata <- subset(errdata, !(time == 0 & variable %in% fixed_initials)) n.optim.overall <- length(parms.optim) - length(fit$errparms) diff --git a/log/check.log b/log/check.log index 967b51d0..b44bc1b4 100644 --- a/log/check.log +++ b/log/check.log @@ -1,14 +1,16 @@ * using log directory ‘/home/jranke/git/mkin/mkin.Rcheck’ -* using R version 4.2.2 Patched (2022-11-10 r83330) +* using R version 4.2.2 (2022-10-31) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘1.3.0’ +* this is package ‘mkin’ version ‘1.2.3’ * package encoding: UTF-8 -* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers +* checking CRAN incoming feasibility ... NOTE Maintainer: ‘Johannes Ranke ’ + +The Date field is over a month old. * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK @@ -41,7 +43,7 @@ Maintainer: ‘Johannes Ranke ’ * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK -* checking R code for possible problems ... OK +* checking R code for possible problems ... [14s/14s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -58,17 +60,21 @@ Maintainer: ‘Johannes Ranke ’ * checking sizes of PDF files under ‘inst/doc’ ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... [10s/10s] OK +* checking examples ... [18s/18s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK -* checking re-building of vignette outputs ... OK +* checking re-building of vignette outputs ... [12s/12s] OK * checking PDF version of manual ... OK -* checking HTML version of manual ... OK +* skipping checking HTML version of manual: no command ‘tidy’ found * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE -Status: OK +Status: 1 NOTE +See + ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ +for details. + diff --git a/log/test.log b/log/test.log index 42ed75e4..d4fb85a2 100644 --- a/log/test.log +++ b/log/test.log @@ -1,53 +1,54 @@ +ℹ Loading mkin ℹ Testing mkin ✔ | F W S OK | Context ✔ | 5 | AIC calculation -✔ | 5 | Analytical solutions for coupled models [1.4s] +✔ | 5 | Analytical solutions for coupled models [2.8s] ✔ | 5 | Calculation of Akaike weights ✔ | 3 | Export dataset for reading into CAKE -✔ | 12 | Confidence intervals and p-values [0.4s] -✔ | 1 12 | Dimethenamid data from 2018 [11.6s] +✔ | 12 | Confidence intervals and p-values [1.0s] +✔ | 1 12 | Dimethenamid data from 2018 [31.3s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_dmta.R:99'): Different backends get consistent results for SFO-SFO3+, dimethenamid data Reason: Fitting this ODE model with saemix takes about 15 minutes on my system ──────────────────────────────────────────────────────────────────────────────── -✔ | 14 | Error model fitting [2.3s] +✔ | 14 | Error model fitting [6.9s] ✔ | 5 | Time step normalisation -✔ | 4 | Calculation of FOCUS chi2 error levels [0.3s] -✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.4s] -✔ | 4 | Test fitting the decline of metabolites from their maximum [0.2s] -✔ | 1 | Fitting the logistic model [0.1s] -✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [18.5s] -✔ | 1 11 | Nonlinear mixed-effects models [5.9s] +✔ | 4 | Calculation of FOCUS chi2 error levels [0.5s] +✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.7s] +✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3s] +✔ | 1 | Fitting the logistic model [0.2s] +✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [42.7s] +✔ | 1 11 | Nonlinear mixed-effects models [13.1s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits Reason: Fitting with saemix takes around 10 minutes when using deSolve ──────────────────────────────────────────────────────────────────────────────── ✔ | 3 | Test dataset classes mkinds and mkindsg -✔ | 10 | Special cases of mkinfit calls [0.4s] -✔ | 3 | mkinfit features [0.5s] -✔ | 8 | mkinmod model generation and printing -✔ | 3 | Model predictions with mkinpredict [0.1s] -✔ | 12 | Multistart method for saem.mmkin models [21.1s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.5s] -✔ | 9 | Nonlinear mixed-effects models with nlme [3.4s] -✔ | 15 | Plotting [4.4s] +✔ | 10 | Special cases of mkinfit calls [0.6s] +✔ | 3 | mkinfit features [0.6s] +✔ | 8 | mkinmod model generation and printing [0.2s] +✔ | 3 | Model predictions with mkinpredict [0.3s] +✔ | 12 | Multistart method for saem.mmkin models [74.1s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.9s] +✔ | 9 | Nonlinear mixed-effects models with nlme [8.5s] +✔ | 15 | Plotting [11.4s] ✔ | 4 | Residuals extracted from mkinfit models -✔ | 1 36 | saemix parent models [29.4s] +✔ | 1 36 | saemix parent models [73.9s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem Reason: This still takes almost 2.5 minutes although we do not solve ODEs ──────────────────────────────────────────────────────────────────────────────── -✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [0.5s] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.1s] ✔ | 11 | Processing of residue series -✔ | 10 | Fitting the SFORB model [1.6s] +✔ | 10 | Fitting the SFORB model [3.1s] ✔ | 1 | Summaries of old mkinfit objects -✔ | 5 | Summary -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [0.8s] -✔ | 9 | Hypothesis tests [2.9s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [0.7s] +✔ | 5 | Summary [0.1s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [1.7s] +✔ | 9 | Hypothesis tests [6.0s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [1.9s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 108.9 s +Duration: 285.4 s ── Skipped tests ────────────────────────────────────────────────────────────── • Fitting this ODE model with saemix takes about 15 minutes on my system (1) diff --git a/man/mkinfit.Rd b/man/mkinfit.Rd index f96b4d22..b5b24449 100644 --- a/man/mkinfit.Rd +++ b/man/mkinfit.Rd @@ -23,8 +23,8 @@ mkinfit( atol = 1e-08, rtol = 1e-10, error_model = c("const", "obs", "tc"), - error_model_algorithm = c("auto", "d_3", "direct", "twostep", "threestep", "fourstep", - "IRLS", "OLS"), + error_model_algorithm = c("auto", "d_3", "direct", "twostep", "threestep", + "fourstep", "IRLS", "OLS"), reweight.tol = 1e-08, reweight.max.iter = 10, trace_parms = FALSE, diff --git a/man/set_nd_nq.Rd b/man/set_nd_nq.Rd index 87a3fae1..796c27a2 100644 --- a/man/set_nd_nq.Rd +++ b/man/set_nd_nq.Rd @@ -54,9 +54,9 @@ it automates the proposal of Boesten et al (2015). } \section{Functions}{ \itemize{ -\item \code{set_nd_nq_focus()}: Set non-detects in residue time series according to FOCUS rules - +\item \code{set_nd_nq_focus}: Set non-detects in residue time series according to FOCUS rules }} + \examples{ # FOCUS (2014) p. 75/76 and 131/132 parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd") diff --git a/tests/testthat/_snaps/multistart/llhist-for-dfop-sfo-fit.svg b/tests/testthat/_snaps/multistart/llhist-for-dfop-sfo-fit.svg index 6015aed8..6be8b9dd 100644 --- a/tests/testthat/_snaps/multistart/llhist-for-dfop-sfo-fit.svg +++ b/tests/testthat/_snaps/multistart/llhist-for-dfop-sfo-fit.svg @@ -52,8 +52,8 @@ - - + + diff --git a/tests/testthat/_snaps/multistart/mixed-model-fit-for-saem-object-with-mkin-transformations.svg b/tests/testthat/_snaps/multistart/mixed-model-fit-for-saem-object-with-mkin-transformations.svg index 69fa6a4d..ed8dcd4d 100644 --- a/tests/testthat/_snaps/multistart/mixed-model-fit-for-saem-object-with-mkin-transformations.svg +++ b/tests/testthat/_snaps/multistart/mixed-model-fit-for-saem-object-with-mkin-transformations.svg @@ -2099,7 +2099,7 @@ - + diff --git a/tests/testthat/_snaps/multistart/parplot-for-dfop-sfo-fit.svg b/tests/testthat/_snaps/multistart/parplot-for-dfop-sfo-fit.svg index b01dac74..990b17c0 100644 --- a/tests/testthat/_snaps/multistart/parplot-for-dfop-sfo-fit.svg +++ b/tests/testthat/_snaps/multistart/parplot-for-dfop-sfo-fit.svg @@ -25,104 +25,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -162,28 +162,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/plot/mixed-model-fit-for-nlme-object.svg b/tests/testthat/_snaps/plot/mixed-model-fit-for-nlme-object.svg index 76fed0dc..47e2b8cc 100644 --- a/tests/testthat/_snaps/plot/mixed-model-fit-for-nlme-object.svg +++ b/tests/testthat/_snaps/plot/mixed-model-fit-for-nlme-object.svg @@ -900,7 +900,7 @@ - + -- cgit v1.2.1