Skip to content

Instantly share code, notes, and snippets.

@shanmdphd
Last active September 18, 2024 19:56
Show Gist options
  • Save shanmdphd/ed97be3934f49931076e24f3d186c030 to your computer and use it in GitHub Desktop.
Save shanmdphd/ed97be3934f49931076e24f3d186c030 to your computer and use it in GitHub Desktop.
How to prepare a vector for the "dose" argument in NonCompart R package
# devtools::install_github("dpastoor/PKPDdatasets")
library(NonCompart)
library(PKPDdatasets)
library(dplyr)
head(PKPDdatasets::sd_iv_rich_pkpd) # One-compartment single IV bolus PKPD
sd_iv_rich_pkpd_dose <- PKPDdatasets::sd_iv_rich_pkpd %>%
select(ID, DOSE) %>%
distinct() %>%
.$DOSE
sd_iv_rich_pkpd_dose # 60 patients of 3 dose levels of 1, 10, 100 mg
tblNCA(PKPDdatasets::sd_iv_rich_pkpd,
key = "ID",
colTime = "TIME",
colConc = "COBS",
dose = sd_iv_rich_pkpd_dose)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment