aboutsummaryrefslogtreecommitdiff
path: root/R/lrtest.mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-11-04 17:21:04 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2019-11-04 17:29:48 +0100
commit31fd7412f46c9715962763d435cb0060ea420752 (patch)
tree771183a2c729131e7364f0a41dae967f73dc150e /R/lrtest.mkinfit.R
parent0220b25f01a4451fa44a7b2f30f5849c4d822a9c (diff)
Include fixed parameters in model names in lrtest
Diffstat (limited to 'R/lrtest.mkinfit.R')
-rw-r--r--R/lrtest.mkinfit.R18
1 files changed, 14 insertions, 4 deletions
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)) {

Contact - Imprint