diff --git a/R/fitnlme.R b/R/fitnlme.R index ec57755..bc43e81 100644 --- a/R/fitnlme.R +++ b/R/fitnlme.R @@ -157,8 +157,11 @@ nlme_gastempt = function(d, pnlsTol = 1.E-3, model = linexp, variant = 1) { newdata = expand.grid(record = levels(d$record), minute = seq(0, max(d$minute), length.out = 50)) newdata$vol = predict(d_nlme, newdata) - plot = plot + geom_line(data = newdata, col = "#006400") + - ggtitle(paste0(title, ", pnlsTol = ", pnlsTol), subtitle = comment(d)) + plot = plot + + geom_line(data = newdata, col = "#006400") + + ggtitle(paste0(title, ", pnlsTol = ", pnlsTol), subtitle = comment(d)) + + geom_vline(data = cf, aes(xintercept = t50), color = "lightgreen" ) + ret = list(coef = cf, nlme_result = d_nlme, plot = plot, pnlsTol = pnlsTol, message = "Ok") class(ret) = "nlme_gastempt" diff --git a/R/stan_gastempt.R b/R/stan_gastempt.R index 1ea7468..1b9f2dd 100644 --- a/R/stan_gastempt.R +++ b/R/stan_gastempt.R @@ -119,7 +119,9 @@ stan_gastempt = function(d, model_name = "linexp_gastro_2b", lkj = 2, }) plot = plot + geom_line(data = newdata, col = "#006400") + - ggtitle(title, subtitle = comment(d)) + ggtitle(title, subtitle = comment(d)) + + geom_vline(data = coef, aes(xintercept = t50), color = "lightgreen" ) + # Assemble return ret = list(coef = coef, fit = fit, plot = plot)