adpc_a <- adpc %>%
filter(
PARAM == "Plasma Drug X",
ARMCD == "ARM A"
) %>%
mutate(avalog = ifelse(AVAL != 0, AVAL, 0.001)) %>%
mutate(Patient_ID = sub(".*id-", "", USUBJID))
use_title2 <- "Plot of Plasma Drug X (ug/mL) Concentrations Over Time by\nPatient: PK Evaluable Patients"
use_subtitle2 <- "Analyte: Plasma Drug X (ug/mL) \nTreatment Group: ARM A"
use_footnote2 <- "Program: \nOutput:"
result <- g_ipp(
df = adpc_a,
xvar = "NFRLT",
yvar = "avalog",
xlab = "Norminal Time from First Dose (hr)",
ylab = "Concentration (ug/mL)",
id_var = "Patient_ID",
add_baseline_hline = FALSE,
yvar_baseline = "AVAL",
title = use_title2,
subtitle = use_subtitle2,
caption = use_footnote2,
plotting_choices = "separate_by_obs"
)
plot <- result[[1]] + 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