PKCG02
Plot of PK Concentration Over Time by Cohort/Treatment Group/Dose
Code
adpc_a <- adpc %>%
filter(
PARAM == "Plasma Drug X",
ARMCD == "ARM A"
) %>%
mutate(Patient_ID = sub(".*id-", "", USUBJID)) %>%
filter(Patient_ID %in% unique(Patient_ID)[1:10])
use_title1 <- "Plot of X Concentration (ug/mL) Over Time by Treatment: \nPK Evaluable Patients"
use_subtitle1 <- "Analyte: Plasma X (ug/mL) \nTreatment Group: ARM A"
use_footnote1 <- "Program: \nOutput:"
plot <- g_ipp(
df = adpc_a,
xvar = "NFRLT",
yvar = "AVAL",
xlab = "Norminal Time from First Dose (hr)",
ylab = "Concentration (ug/mL)",
id_var = "Patient_ID",
add_baseline_hline = FALSE,
yvar_baseline = "AVAL", # yvar_baseline cannot be NA or ignore
title = use_title1,
subtitle = use_subtitle1,
caption = use_footnote1,
plotting_choices = "all_in_one"
)
plot
Code
adpc_a <- adpc %>%
filter(
PARAM == "Plasma Drug X",
ARMCD == "ARM A"
) %>%
mutate(Patient_ID = sub(".*id-", "", USUBJID)) %>%
mutate(avalog = ifelse(AVAL != 0, AVAL, 0.001)) %>%
filter(Patient_ID %in% unique(Patient_ID)[1:10])
use_title3 <- "Log-scale Plot of X Concentration (ug/mL) Over Time by Treatment: \nPK Evaluable Patients"
use_subtitle3 <- "Analyte: Plasma X (ug/mL) \nTreatment Group: ARM A"
use_footnote3 <- "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", # yvar_baseline cannot be NA or ignore
title = use_title3,
caption = use_footnote3,
subtitle = use_subtitle3,
plotting_choices = "all_in_one"
)
plot <- result + 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
Timestamp
Session Info
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale:
[1] C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] nestcolor_0.1.2.9010 ggplot2_3.5.1 dplyr_1.1.4
[4] tern_0.9.4.9007 rtables_0.6.7.9002 magrittr_2.0.3
[7] formatters_0.5.6.9004
loaded via a namespace (and not attached):
[1] utf8_1.2.4 generics_0.1.3
[3] tidyr_1.3.1 stringi_1.8.3
[5] lattice_0.22-6 digest_0.6.35
[7] evaluate_0.23 grid_4.4.0
[9] fastmap_1.1.1 jsonlite_1.8.8
[11] Matrix_1.7-0 backports_1.4.1
[13] brio_1.1.5 survival_3.6-4
[15] purrr_1.0.2 fansi_1.0.6
[17] scales_1.3.0 codetools_0.2-20
[19] Rdpack_2.6 cli_3.6.2
[21] rlang_1.1.3 rbibutils_2.2.16
[23] munsell_0.5.1 splines_4.4.0
[25] withr_3.0.0 yaml_2.3.8
[27] tools_4.4.0 checkmate_2.3.1
[29] colorspace_2.1-0 broom_1.0.5
[31] vctrs_0.6.5 R6_2.5.1
[33] lifecycle_1.0.4 stringr_1.5.1
[35] htmlwidgets_1.6.4 pkgconfig_2.0.3
[37] pillar_1.9.0 gtable_0.3.5
[39] glue_1.7.0 xfun_0.43
[41] tibble_3.2.1 tidyselect_1.2.1
[43] knitr_1.46 farver_2.1.1
[45] htmltools_0.5.8.1 rmarkdown_2.26
[47] labeling_0.4.3 testthat_3.2.1.1
[49] random.cdisc.data_0.3.15.9003 compiler_4.4.0
.lock
file
Download the .lock
file and use renv::restore()
on it to recreate environment used to generate this website.
Code
parent_file_path <- knitr::current_input(dir = TRUE)
book_root_dir <- parent_file_path
while (!file.exists(file.path(book_root_dir, "_quarto.yml"))) book_root_dir <- dirname(book_root_dir)
lock_path <- file.path(
"../../assets/www/lock",
paste0(
gsub(
file.path(book_root_dir, ""),
"",
gsub(
"\\.rmarkdown$",
"",
knitr::current_input(dir = TRUE)
)
),
".lock"
)
)
withr::with_options(
list(renv.verbose = FALSE),
renv::snapshot(parent_file_path, lockfile = lock_path, prompt = FALSE, force = TRUE)
)