From 31fd7412f46c9715962763d435cb0060ea420752 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 4 Nov 2019 17:21:04 +0100 Subject: Include fixed parameters in model names in lrtest --- R/lrtest.mkinfit.R | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'R/lrtest.mkinfit.R') diff --git a/R/lrtest.mkinfit.R b/R/lrtest.mkinfit.R index 60b6c46a..a5689830 100644 --- a/R/lrtest.mkinfit.R +++ b/R/lrtest.mkinfit.R @@ -30,17 +30,27 @@ lmtest::lrtest #' dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE) #' lrtest(dfop_fit, sfo_fit) #' lrtest(sfo_fit, dfop_fit) -#' +#' #' # The following two examples are commented out as they fail during #' # generation of the static help pages by pkgdown -#' # lrtest(dfop_fit, error_model = "tc") -#' # lrtest(dfop_fit, fixed_parms = c(k2 = 0)) +#' #lrtest(dfop_fit, error_model = "tc") +#' #lrtest(dfop_fit, fixed_parms = c(k2 = 0)) +#' +#' # However, this equivalent syntax works for static help pages +#' lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) +#' lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) #' } #' @export lrtest.mkinfit <- function(object, object_2 = NULL, ...) { name_function <- function(x) { - paste(x$mkinmod$name, "with error model", x$err_mod) + object_name <- paste(x$mkinmod$name, "with error model", x$err_mod) + if (length(x$bparms.fixed) > 0) { + object_name <- paste(object_name, + "and fixed parameter(s)", + paste(names(x$bparms.fixed), collapse = ", ")) + } + return(object_name) } if (is.null(object_2)) { -- cgit v1.2.1