h_g_ipp(
df,
xvar,
yvar,
xlab,
ylab,
id_var,
title = "Individual Patient Plots",
subtitle = "",
caption = NULL,
add_baseline_hline = FALSE,
yvar_baseline = "BASE",
ggtheme = nestcolor::theme_nest(),
col = NULL
)
(data.frame
)
data set containing all analysis variables.
(string
)
time point variable to be plotted on x-axis.
(string
)
continuous analysis variable to be plotted on y-axis.
(string
)
plot label for x-axis.
(string
)
plot label for y-axis.
(string
)
variable used as patient identifier.
(string
)
title for plot.
(string
)
subtitle for plot.
(string
)
optional caption below the plot.
(flag
)
adds horizontal line at baseline y-value on
plot when TRUE
.
(string
)
variable with baseline values only.
Ignored when add_baseline_hline
is FALSE
.
(theme
)
optional graphical theme function as provided
by ggplot2
to control outlook of plot. Use ggplot2::theme()
to tweak the display.
(character
)
line colors.
A ggplot
line plot.
g_ipp()
which uses this function.
library(dplyr)
# Select a small sample of data to plot.
adlb <- tern_ex_adlb %>%
filter(PARAMCD == "ALT", !(AVISIT %in% c("SCREENING", "BASELINE"))) %>%
slice(1:36)
p <- h_g_ipp(
df = adlb,
xvar = "AVISIT",
yvar = "AVAL",
xlab = "Visit",
id_var = "USUBJID",
ylab = "SGOT/ALT (U/L)",
add_baseline_hline = TRUE
)
p