diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-09 11:59:16 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-09 11:59:16 +0100 |
commit | a52d76a13f36c112e27383af1cac3f98b1bbed0a (patch) | |
tree | 18f61d83823fad7ae67d1ada1975d4e1d7781dfc | |
parent | 8ba0bc6f52183ad97377e4d13d082be13b0383bd (diff) |
object$mmkin_orig -> object$mmkin
-rw-r--r-- | R/nlme.mmkin.R | 6 | ||||
-rw-r--r-- | R/plot.nlme.mmkin.R | 10 | ||||
-rw-r--r-- | R/summary.nlme.mmkin.R | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R index af92e8a1..ca849b85 100644 --- a/R/nlme.mmkin.R +++ b/R/nlme.mmkin.R @@ -183,7 +183,7 @@ nlme.mmkin <- function(model, data = sys.frame(sys.parent()), val$mkinmod <- model[[1]]$mkinmod val$data <- thisCall[["data"]] - val$mmkin_orig <- model + val$mmkin <- model val$mean_dp_start <- mean_dp_start val$transform_rates <- model[[1]]$transform_rates val$transform_fractions <- model[[1]]$transform_fractions @@ -211,7 +211,7 @@ print.nlme.mmkin <- function(x, ...) { cat( "Kinetic nonlinear mixed-effects model fit by " ) cat( if(x$method == "REML") "REML\n" else "maximum likelihood\n") cat("\nStructural model:\n") - diffs <- x$mmkin_orig[[1]]$mkinmod$diffs + diffs <- x$mmkin[[1]]$mkinmod$diffs nice_diffs <- gsub("^(d.*) =", "\\1/dt =", diffs) writeLines(strwrap(nice_diffs, exdent = 11)) cat("\nData:\n") @@ -239,7 +239,7 @@ print.nlme.mmkin <- function(x, ...) { #' @param ... Update specifications passed to update.nlme update.nlme.mmkin <- function(object, ...) { res <- NextMethod() - res$mmkin_orig <- object$mmkin_orig + res$mmkin <- object$mmkin class(res) <- c("nlme.mmkin", "nlme", "lme") return(res) } diff --git a/R/plot.nlme.mmkin.R b/R/plot.nlme.mmkin.R index 05a17a22..4228b18a 100644 --- a/R/plot.nlme.mmkin.R +++ b/R/plot.nlme.mmkin.R @@ -13,8 +13,6 @@ if(getRversion() >= '2.15.1') utils::globalVariables("ds") #' @param ymax Vector of maximum y axis values #' @param ncol.legend Number of columns to use in the legend #' @param nrow.legend Number of rows to use in the legend -#' @param \dots Further arguments passed to \code{\link{plot.mkinfit}} and -#' \code{\link{mkinresplot}}. #' @param resplot Should the residuals plotted against time or against #' predicted values? #' @param col_ds Colors used for plotting the observed data and the @@ -41,7 +39,7 @@ if(getRversion() >= '2.15.1') utils::globalVariables("ds") #' plot(f_nlme) #' } #' @export -plot.nlme.mmkin <- function(x, i = 1:ncol(x$mmkin_orig), +plot.nlme.mmkin <- function(x, i = 1:ncol(x$mmkin), obs_vars = names(x$mkinmod$map), standardized = TRUE, xlab = "Time", @@ -55,13 +53,13 @@ plot.nlme.mmkin <- function(x, i = 1:ncol(x$mmkin_orig), pch_ds = 1:length(i), col_ds = pch_ds + 1, lty_ds = col_ds, - frame = TRUE, ...) + frame = TRUE) { oldpar <- par(no.readonly = TRUE) - fit_1 = x$mmkin_orig[[1]] - ds_names <- colnames(x$mmkin_orig) + fit_1 = x$mmkin[[1]] + ds_names <- colnames(x$mmkin) degparms_optim <- coefficients(x) degparms_optim_names <- names(degparms_optim) diff --git a/R/summary.nlme.mmkin.R b/R/summary.nlme.mmkin.R index d930f845..ad730f9a 100644 --- a/R/summary.nlme.mmkin.R +++ b/R/summary.nlme.mmkin.R @@ -122,8 +122,8 @@ summary.nlme.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = object$date.summary = date() object$use_of_ff = object$mkinmod$use_of_ff - object$error_model_algorithm = object$mmkin_orig[[1]]$error_model_algorithm - err_mod = object$mmkin_orig[[1]]$err_mod + object$error_model_algorithm = object$mmkin[[1]]$error_model_algorithm + err_mod = object$mmkin[[1]]$err_mod object$diffs <- object$mkinmod$diffs object$print_data <- data @@ -139,7 +139,7 @@ summary.nlme.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = object$data[["standardized"]] <- residuals(object, type = "pearson") object$verbose <- verbose - object$fixed <- object$mmkin_orig[[1]]$fixed + object$fixed <- object$mmkin[[1]]$fixed object$AIC = AIC(object) object$BIC = BIC(object) object$logLik = logLik(object) |