From 396e40d2c45d81a8e74c41a2f632665021e980a1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 26 Feb 2019 20:28:15 +0100 Subject: NAFTA SOP Attachment vignette Also: - Change rounding in print.nafta - Add dots argument to nafta() - Use cores=1 in examples - Restrict N in IORE model to values > 0 --- R/mkinfit.R | 4 ++++ R/nafta.R | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'R') diff --git a/R/mkinfit.R b/R/mkinfit.R index 2dec3a72..63455300 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -374,6 +374,10 @@ mkinfit <- function(mkinmod, observed, lower <- rep(-Inf, length(c(state.ini.optim, transparms.optim))) upper <- rep(Inf, length(c(state.ini.optim, transparms.optim))) names(lower) <- names(upper) <- c(names(state.ini.optim), names(transparms.optim)) + + # IORE exponentes are not transformed, but need a lower bound of zero + index_N <- grep("^N", names(lower)) + lower[index_N] <- 0 if (!transform_rates) { index_k <- grep("^k_", names(lower)) lower[index_k] <- 0 diff --git a/R/nafta.R b/R/nafta.R index 03bd77c1..d4d63f6b 100644 --- a/R/nafta.R +++ b/R/nafta.R @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see -nafta <- function(ds, title = NA, quiet = FALSE) { +nafta <- function(ds, title = NA, quiet = FALSE, ...) { if (length(levels(ds$name)) > 1) { stop("The NAFTA procedure is only defined for decline data for a single compound") } @@ -24,7 +24,7 @@ nafta <- function(ds, title = NA, quiet = FALSE) { models <- c("SFO", "IORE", "DFOP") result <- list(title = title, data = ds) - result$mmkin <- mmkin(models, list(ds), quiet = TRUE) + result$mmkin <- mmkin(models, list(ds), quiet = TRUE, ...) distimes <- lapply(result$mmkin, function(x) as.numeric(endpoints(x)$distimes["parent", ])) @@ -73,7 +73,7 @@ print.nafta <- function(x, quiet = TRUE, ...) { print(x$parameters) t_rep <- .evaluate_nafta_results(x$S, x$S_c, x$distimes, quiet = quiet) cat("\nDTx values:\n") - print(round((x$distimes), digits = 0)) + print(signif((x$distimes), 3)) cat("\nRepresentative half-life:\n") print(t_rep) } -- cgit v1.2.1