use_title <- "Plot of Mean (+/- SD) Log-Scale Plasma Concentrations Over Time by Treatment, \nPK Evaluable Patients"
use_subtitle <- "Analyte:"
use_footnote <- "Program: \nOutput:"
adpc <- adpc %>%
mutate(avalog = ifelse(AVAL != 0, AVAL, 0.001))
result <- g_lineplot(
df = adpc,
variables = control_lineplot_vars(
x = "NFRLT",
y = "avalog",
group_var = "ARM",
paramcd = "PARAM",
y_unit = "AVALU",
subject_var = "USUBJID"
),
alt_counts_df = adsl_f,
y_lab = "Concentration",
y_lab_add_paramcd = FALSE,
y_lab_add_unit = TRUE,
interval = "mean_sdi",
whiskers = c("mean_sdi_lwr", "mean_sdi_upr"),
title = use_title,
subtitle = use_subtitle,
caption = use_footnote,
ggtheme = theme_nest()
)
plot <- result + theme(plot.caption = element_text(hjust = 0)) +
ggplot2::scale_y_log10(breaks = c(0.001, 0.01, 0.1, 1, 10), labels = c(0.001, 0.01, 0.1, 1, 10))
plot