Skip to content

Commit

Permalink
Added line a t50
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieter Menne authored and Dieter Menne committed Dec 19, 2024
1 parent 3c5a153 commit 06c9208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions R/fitnlme.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion R/stan_gastempt.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 06c9208

Please sign in to comment.