h_g_ipp {tern} | R Documentation |
Helper function to create simple line plot over time
Description
Function that generates a simple line plot displaying parameter trends over time.
Usage
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
)
Arguments
df |
( |
xvar |
( |
yvar |
( |
xlab |
( |
ylab |
( |
id_var |
( |
title |
( |
subtitle |
( |
caption |
( |
add_baseline_hline |
( |
yvar_baseline |
( |
ggtheme |
( |
col |
( |
Value
A ggplot
line plot.
See Also
g_ipp()
which uses this function.
Examples
library(dplyr)
library(nestcolor)
# 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