plot_tdt_curve: Plot the thermal death-time (TDT) curve: survival-threshold...

View source: R/plotting.R

plot_tdt_curveR Documentation

Plot the thermal death-time (TDT) curve: survival-threshold time vs temperature

Description

plot_tdt_curve() draws the duration at which survival crosses a target probability p against temperature – the classic thermal-death-time line, here read directly off the fitted curve via derive_lt(). With the default p = NULL, each line uses its fitted relative midpoint (low + up) / 2, not necessarily absolute 50% survival. Supply a numeric p for an absolute survival threshold. Time is shown on a log10 axis. For a grouped fit a line is drawn per group.

Usage

plot_tdt_curve(
  fit,
  p = NULL,
  temps = NULL,
  panels = c("log", "linear", "both"),
  colour = NULL,
  target_surv = NULL,
  ...
)

Arguments

fit

A profile_tls fit from fit_tls() or workflow object from fit_4pl(). Workflow objects retain the standardized duration unit.

p

NULL (default) for the fitted relative midpoint, or an absolute target survival probability in ⁠(0, 1)⁠.

temps

Numeric vector of temperatures. Defaults to a sequence over the observed temperature range.

panels

Which duration scale to draw: "log" (default), "linear", or "both". The log default preserves prior freqTLS behavior; bayesTLS defaults to both panels.

colour

Optional fixed line colour. When NULL (default), grouped fits use the group colour aesthetic.

target_surv

Alias for p. Accepts a numeric survival probability, "relative", or "absolute" (which means 0.5).

...

Reserved; must be empty.

Value

A ggplot for one panel. For panels = both, returns a patchwork object when patchwork is installed, or a named list of linear and log ggplots otherwise.

Examples

d <- simulate_tls(family = "binomial", times = c(30, 60, 120, 240, 480),
                  CTmax = 36, z = 4, tref = 60, seed = 1)
dat <- standardize_data(d, temp = "temp", duration = "duration",
  n_total = "total", n_surv = "survived", duration_unit = "minutes")
fit <- fit_4pl(dat, family = "binomial", t_ref = 60,
  method = "wald", quiet = TRUE)
plot_tdt_curve(fit)


freqTLS documentation built on Dec. 4, 2026, 5:11 p.m.