aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-05-08 08:44:36 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2023-05-08 08:44:36 +0200
commitc931057ce8f05d3a0dfefea72b73903efb82e900 (patch)
tree4565f7b18461e6976b0325f0398a9aae6303037e
parent78d34a8918edcb91982a3886e4898a63898f52c3 (diff)
Fix obtaining endpoints for user defined covariate values
-rw-r--r--NEWS.md4
-rw-r--r--R/endpoints.R5
2 files changed, 6 insertions, 3 deletions
diff --git a/NEWS.md b/NEWS.md
index f0e38528..b354afe6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,12 +1,12 @@
# mkin 1.2.4
-
+- R/endpoints.R: Fix the calculation of endpoints for user specified covariate values
# mkin 1.2.3.1 (unreleased)
- Small fixes to get the online docs right (example code in R/hierarchical_kinetics, cluster setup in cyantraniliprole and dmta pathway vignettes, graphics and model comparison in multistart vignette), rebuild online docs
-# mkin 1.2.3
+# mkin 1.2.3 (2023-04-17)
- 'R/{endpoints,parms,plot.mixed.mmkin,summary.saem.mmkin}.R': Calculate parameters and endpoints and plot population curves for specific covariate values, or specific percentiles of covariate values used in saem fits.
diff --git a/R/endpoints.R b/R/endpoints.R
index 0aafd728..c3e0a0d3 100644
--- a/R/endpoints.R
+++ b/R/endpoints.R
@@ -49,7 +49,10 @@ endpoints <- function(fit, covariates = NULL, covariate_quantile = 0.5) {
apply(fit$covariates, 2, quantile,
covariate_quantile, simplify = FALSE))
} else {
- covariates <- data.frame("User" = covariates)
+ covariate_m <- matrix(covariates, byrow = TRUE)
+ colnames(covariate_m) <- names(covariates)
+ rownames(covariate_m) <- "User"
+ covariates <- as.data.frame(covariate_m)
}
degparms_trans <- parms(fit, covariates = covariates)[, 1]
if (inherits(fit, "saem.mmkin") & (fit$transformations == "saemix")) {

Contact - Imprint