## Simple ex domain with 1 subject and 1 dose
ex <- data.frame(STUDYID = "ABC101",
USUBJID = "ABC101-001",
EXSTDTC = "2000-01-01 10:00:00",
EXSTDY = 1,
EXTPTNUM = 0,
EXDOSE = 100,
CMT = 1,
EXTRT = "ABC",
EXDOSU = "mg",
VISIT = "Day 1",
EXTPT = "Dose",
EXDOSFRQ = "Once",
EXROUTE = "Oral")
## Simple pc domain with 1 subject and 3 observations
pc <- data.frame(USUBJID = "ABC101-001",
PCDTC = c("2000-01-01 09:40:00",
"2000-01-01 10:29:00",
"2000-01-01 12:05:00"),
PCDY = 1,
PCTPTNUM = c(0, ##Units of hours
0.021,
0.083),
PCSTRESN = c(NA,
469,
870),
PCLLOQ = 25,
CMT = 2,
VISIT = "Day 1",
PCTPT = c("Pre-dose",
"30-min post-dose",
"2-hr post-dose"),
PCTEST = "ABC",
PCSTRESU = "ug/mL")
## Create with pk_build()
df <- pk_build(ex, pc)
## Simple dm domain for the corresponding study
dm <- data.frame(USUBJID = c("ABC101-001",
"ABC101-002",
"ABC101-003"),
AGE = c(45,
37,
73),
AGEU = "years",
SEX = c("Male",
"Female",
"Male"),
RACE = c("White",
"White",
"Black"),
ETHNIC = c("Not Hispanic/Latino",
"Not Hispanic/Latino",
"Not Hispanic/Latino"))
## Add covariates with cov_apply()
df1 <- cov_apply(df, dm)
Run the code above in your browser using DataLab