From c29e27b9bf5f5361db44e28b06da7b8a1e636e85 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sat, 9 Apr 2022 06:21:23 +0200 Subject: Improvements to mean_degparms() and plot.mixed.mmkin() - New argument 'default_log_parms' for mean_degparms() - 'plot.mixed.mmkin': Pass the frame argument also to residual plots, take the 'default_log_parms' argument for 'mean_degparms' used for constructing approximate population curves, plot population curve last to avoid that it is covered by data --- R/mean_degparms.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'R/mean_degparms.R') diff --git a/R/mean_degparms.R b/R/mean_degparms.R index ec20c068..fdcc5c00 100644 --- a/R/mean_degparms.R +++ b/R/mean_degparms.R @@ -11,8 +11,12 @@ #' rate constants) pass the t-test for significant difference from zero. #' @param conf.level Possibility to adjust the required confidence level #' for parameter that are tested if requested by 'test_log_parms'. +#' @param default_log_parms If set to a numeric value, this is used +#' as a default value for the tested log parameters that failed the +#' t-test. #' @export -mean_degparms <- function(object, random = FALSE, test_log_parms = FALSE, conf.level = 0.6) +mean_degparms <- function(object, random = FALSE, test_log_parms = FALSE, conf.level = 0.6, + default_log_parms = NA) { if (nrow(object) > 1) stop("Only row objects allowed") parm_mat_trans <- sapply(object, parms, transformed = TRUE) @@ -33,7 +37,7 @@ mean_degparms <- function(object, random = FALSE, test_log_parms = FALSE, conf.l parm_mat_trans_OK <- parm_mat_trans for (trans_parm in log_parm_trans_names) { parm_mat_trans_OK[trans_parm, ] <- ifelse(t_test_back_OK[trans_parm, ], - parm_mat_trans[trans_parm, ], NA) + parm_mat_trans[trans_parm, ], default_log_parms) } } else { parm_mat_trans_OK <- parm_mat_trans -- cgit v1.2.1