Pharmacokinetic (PK) data programming in {admiral} and the Pharmaverse

R/Pharma 2023

Jeff Dickinson, Navitas Data Sciences

Agenda

  • What is PK data
  • Types of PK analysis data
  • Brief overview of {admiral} and the Pharmaverse
  • Programming Workflow
  • Some Additional Pharmaverse tools
  • Pharmaverse Website Example

Pharmacokinetics Overview

  • Pharmacokinetics is the interaction of a drug with the body

  • Samples collected at regular time intervals after dosing

  • Metrics calculated from concentrations over time

Two Main Types of Modelling

  • Non-Compartmental Analysis (NCA)

  • Population PK (PopPK)

Non-Compartmental Analysis (NCA) – ADNCA/ADPC

  • Individual Based
  • Intensive Sampling
  • Derive Parameters e.g. AUC, TMAX, CMAX

Population PK (PopPK) – ADPPK

  • Population Based
  • Less Intensive Sampling
  • Can Detect Variations based on Covariates

CDISC Standards for Non-Compartmental Analysis

https://www.cdisc.org/standards/foundational/adam/adamig-non-compartmental-analysis-input-data-v1-0

CDISC Standards for Population PK Analysis

Published October 6, 2023!

https://www.cdisc.org/standards/foundational/adam/basic-data-structure-adam-poppk-implementation-guide-v1-0

CDISC ADaM PK Standards

  • ADNCA (NCA) – released November 2021
  • ADPPK (PopPK) – released October 2023
  • ADPP (PK Parameters) – coming in 2024

Characteristics of PK Analysis Data

  • Includes both exposure (EX) and concentration data (PC)
  • Includes nominal and actual relative time variables
  • Duplicated Records for Analysis (ADNCA)
  • Numeric Covariates for Modelling (ADPPK)
  • May need to expand dosing records

Time Variables (ADNCA)

Variable Variable Label
NFRLT Nom. Rel. Time from Analyte First Dose
AFRLT Act. Rel. Time from Analyte First Dose
NRRLT Nominal Rel. Time from Ref. Dose
ARRLT Actual Rel. Time from Ref. Dose
MRRLT Modified Rel. Time from Ref. Dose

Note: a relative time variable may refer to previous dose or next dose

Nominal vs. Actual Relative Time

Time Variables (ADPPK)

Variable Variable Label
NFRLT Nominal Rel Time from First Dose
AFRLT Actual Rel Time from First Dose
NPRLT Nominal Rel Time from Previous Dose
APRLT Actual Rel Time from Previous Dose

Time Variables Example

USUBJID EVID NFRLT AFRLT NPRLT APRLT
001 0 0 -0.05 0 -0.05
001 1 0 0 0 0
001 0 0.5 0.465 0.5 0.465
001 0 3 2.89 3 2.89
001 1 24 24.05 0 0
001 0 25 25.15 1 1.15

ADPPK Expected Variables

  • EVID Event ID
  • DV Dependent Variable
  • MDV Missing Dependent Variable
  • BLQ Below Limit of Quantitation

ADPPK Covariates

  • <COV>BL for baseline covariate, (e.g., WTBL, BMIBL)
  • <COV>N for numerical version of categorical covariate (e.g., SEXN, RACEN)
  • <COV>I for any covariates with imputed values (e.g., WTI, BMII)
  • <COV>GRy for grouping covariates (e.g. AGEGR1)

{admiral}

  • ADaM in R Asset Library
  • {admiral} is Open Source and Collaborative
  • {admiral} is a Modular Set of Functions
  • PK Templates and Vignette Available
  • Stable 1.0 Release Expected in December

https://github.com/pharmaverse/admiral

{admiral} PK Templates and Vignette

https://pharmaverse.github.io/admiral/cran-release/articles/pk_adnca.html

{admiral} Date/Time Functions

  • derive_vars_dtm()
  • derive_vars_dtm_to_dt()
  • derive_vars_dtm_to_tm()
  • derive_vars_dy()
  • derive_vars_duration()

{admiral} Merge and Join Functions

  • derive_vars_merged()
  • derive_vars_joined()
  • derive_vars_transposed()
  • create_single_dose_dataset()

{admiral} Special Purpose Functions

  • compute_bmi()
  • compute_bsa()
  • compute_egfr()

Welcome to the Pharmaverse

https://pharmaverse.org/

Other Pharmaverse Packages in ADPPK Workflow

  • {pharmaversesdtm} CDISC pilot SDTM data
  • {metacore} Store metadata
  • {metatools} Work with metadata and perform checks
  • {xportr} Perform checks and export transport files (XPT)

End to End Example Site

https://pharmaverse.github.io/e2e_pk/

Will focus on ADPPK example

Coding Highlights

  • Load Specs with {metacore}
  • Derive PC Dates
  • Expand Dosing Records
  • Find First Dose
  • Find Previous Dose
  • Find Previous Nominal Dose
  • Derive Covariates Using {metacore}
  • {metacore} Checks
  • {xportr} Steps

Load Specs with {metacore}

# ---- Load Specs for Metacore ----
metacore <- spec_to_metacore("pk_spec.xlsx") %>%
  select_dataset("ADPPK")

Derive PC Dates

pc_dates <- pc %>%
  # Join ADSL with PC (need TRTSDT for ADY derivation)
  derive_vars_merged(
    dataset_add = adsl,
    new_vars = adsl_vars,
    by_vars = exprs(STUDYID, USUBJID)
  ) %>%
  # Derive analysis date/time
  # Impute missing time to 00:00:00
  derive_vars_dtm(
    new_vars_prefix = "A",
    dtc = PCDTC,
    time_imputation = "00:00:00"
  ) %>%
  # Derive dates and times from date/times
  derive_vars_dtm_to_dt(exprs(ADTM)) %>%
  derive_vars_dtm_to_tm(exprs(ADTM)) %>%
  # Derive event ID and nominal relative time from first dose (NFRLT)
  mutate(
    EVID = 0,
    DRUG = PCTEST,
    NFRLT = if_else(PCTPTNUM < 0, 0, PCTPTNUM), .after = USUBJID
  )
# A tibble: 14 × 6
   USUBJID     VISIT    PCTPT            PCDTC         ADTM                NFRLT
   <chr>       <chr>    <chr>            <chr>         <dttm>              <dbl>
 1 01-701-1028 BASELINE Pre-dose         2013-07-18T2… 2013-07-18 23:30:00  0   
 2 01-701-1028 BASELINE 5 Min Post-dose  2013-07-19T0… 2013-07-19 00:05:00  0.08
 3 01-701-1028 BASELINE 30 Min Post-dose 2013-07-19T0… 2013-07-19 00:30:00  0.5 
 4 01-701-1028 BASELINE 1h Post-dose     2013-07-19T0… 2013-07-19 01:00:00  1   
 5 01-701-1028 BASELINE 1.5h Post-dose   2013-07-19T0… 2013-07-19 01:30:00  1.5 
 6 01-701-1028 BASELINE 2h Post-dose     2013-07-19T0… 2013-07-19 02:00:00  2   
 7 01-701-1028 BASELINE 4h Post-dose     2013-07-19T0… 2013-07-19 04:00:00  4   
 8 01-701-1028 BASELINE 6h Post-dose     2013-07-19T0… 2013-07-19 06:00:00  6   
 9 01-701-1028 BASELINE 8h Post-dose     2013-07-19T0… 2013-07-19 08:00:00  8   
10 01-701-1028 BASELINE 12h Post-dose    2013-07-19T1… 2013-07-19 12:00:00 12   
11 01-701-1028 BASELINE 16h Post-dose    2013-07-19T1… 2013-07-19 16:00:00 16   
12 01-701-1028 BASELINE 24h Post-dose    2013-07-20T0… 2013-07-20 00:00:00 24   
13 01-701-1028 BASELINE 36h Post-dose    2013-07-20T1… 2013-07-20 12:00:00 36   
14 01-701-1028 BASELINE 48h Post-dose    2013-07-21T0… 2013-07-21 00:00:00 48   

Expand Dosing Records

ex_exp <- ex_dates %>%
  create_single_dose_dataset(
    dose_freq = EXDOSFRQ,
    start_date = ASTDT,
    start_datetime = ASTDTM,
    end_date = AENDT,
    end_datetime = AENDTM,
    nominal_time = NFRLT,
    lookup_table = dose_freq_lookup,
    lookup_column = CDISC_VALUE,
    keep_source_vars = exprs(
      STUDYID, USUBJID, EVID, EXDOSFRQ, EXDOSFRM,
      NFRLT, EXDOSE, EXDOSU, EXTRT, ASTDT, ASTDTM, AENDT, AENDTM,
      VISIT, VISITNUM, VISITDY,
      TRT01A, TRT01P, DOMAIN, EXSEQ, !!!adsl_vars
    )
  ) %>%
  # Derive AVISIT based on nominal relative time
  # Derive AVISITN to nominal time in whole days using integer division
  # Define AVISIT based on nominal day
  mutate(
    AVISITN = NFRLT %/% 24 + 1,
    AVISIT = paste("Day", AVISITN),
    ADTM = ASTDTM,
    DRUG = EXTRT
  ) %>%
  # Derive dates and times from datetimes
  derive_vars_dtm_to_dt(exprs(ADTM)) %>%
  derive_vars_dtm_to_tm(exprs(ADTM)) %>%
  derive_vars_dtm_to_tm(exprs(ASTDTM)) %>%
  derive_vars_dtm_to_tm(exprs(AENDTM))
# A tibble: 3 × 7
  USUBJID     EXTRT EXDOSFRQ VISIT NFRLT ASTDTM              AENDTM             
  <chr>       <chr> <chr>    <chr> <dbl> <dttm>              <dttm>             
1 01-701-1028 XANO… QD       BASE…     0 2013-07-19 00:00:00 2013-08-01 00:00:00
2 01-701-1028 XANO… QD       WEEK…   312 2013-08-02 00:00:00 2014-01-06 00:00:00
3 01-701-1028 XANO… QD       WEEK…  4008 2014-01-07 00:00:00 2014-01-14 00:00:00
# A tibble: 20 × 6
   USUBJID     EXTRT      EXDOSFRQ AVISIT NFRLT ASTDTM             
   <chr>       <chr>      <chr>    <chr>  <dbl> <dttm>             
 1 01-701-1028 XANOMELINE ONCE     Day 1      0 2013-07-19 00:00:00
 2 01-701-1028 XANOMELINE ONCE     Day 2     24 2013-07-20 00:00:00
 3 01-701-1028 XANOMELINE ONCE     Day 3     48 2013-07-21 00:00:00
 4 01-701-1028 XANOMELINE ONCE     Day 4     72 2013-07-22 00:00:00
 5 01-701-1028 XANOMELINE ONCE     Day 5     96 2013-07-23 00:00:00
 6 01-701-1028 XANOMELINE ONCE     Day 6    120 2013-07-24 00:00:00
 7 01-701-1028 XANOMELINE ONCE     Day 7    144 2013-07-25 00:00:00
 8 01-701-1028 XANOMELINE ONCE     Day 8    168 2013-07-26 00:00:00
 9 01-701-1028 XANOMELINE ONCE     Day 9    192 2013-07-27 00:00:00
10 01-701-1028 XANOMELINE ONCE     Day 10   216 2013-07-28 00:00:00
11 01-701-1028 XANOMELINE ONCE     Day 11   240 2013-07-29 00:00:00
12 01-701-1028 XANOMELINE ONCE     Day 12   264 2013-07-30 00:00:00
13 01-701-1028 XANOMELINE ONCE     Day 13   288 2013-07-31 00:00:00
14 01-701-1028 XANOMELINE ONCE     Day 14   312 2013-08-01 00:00:00
15 01-701-1028 XANOMELINE ONCE     Day 14   312 2013-08-02 00:00:00
16 01-701-1028 XANOMELINE ONCE     Day 15   336 2013-08-03 00:00:00
17 01-701-1028 XANOMELINE ONCE     Day 16   360 2013-08-04 00:00:00
18 01-701-1028 XANOMELINE ONCE     Day 17   384 2013-08-05 00:00:00
19 01-701-1028 XANOMELINE ONCE     Day 18   408 2013-08-06 00:00:00
20 01-701-1028 XANOMELINE ONCE     Day 19   432 2013-08-07 00:00:00

Find First Dose

adppk_first_dose <- pc_dates %>%
  derive_vars_merged(
    dataset_add = ex_exp,
    filter_add = (!is.na(ADTM)),
    new_vars = exprs(FANLDTM = ADTM, EXDOSE_first = EXDOSE),
    order = exprs(ADTM, EXSEQ),
    mode = "first",
    by_vars = exprs(STUDYID, USUBJID, DRUG)
  ) %>%
  filter(!is.na(FANLDTM)) %>%
  # Derive AVISIT based on nominal relative time
  # Derive AVISITN to nominal time in whole days using integer division
  # Define AVISIT based on nominal day
  mutate(
    AVISITN = NFRLT %/% 24 + 1,
    AVISIT = paste("Day", AVISITN),
  )
# A tibble: 14 × 7
   USUBJID   DRUG  FANLDTM             AVISIT PCTPT ADTM                PCSTRESC
   <chr>     <chr> <dttm>              <chr>  <chr> <dttm>              <chr>   
 1 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  Pre-… 2013-07-18 23:30:00 <BLQ    
 2 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  5 Mi… 2013-07-19 00:05:00 0.10156…
 3 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  30 M… 2013-07-19 00:30:00 0.54690…
 4 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  1h P… 2013-07-19 01:00:00 0.92546…
 5 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  1.5h… 2013-07-19 01:30:00 1.18750…
 6 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  2h P… 2013-07-19 02:00:00 1.36888…
 7 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  4h P… 2013-07-19 04:00:00 1.68314…
 8 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  6h P… 2013-07-19 06:00:00 1.75529…
 9 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  8h P… 2013-07-19 08:00:00 1.77185…
10 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  12h … 2013-07-19 12:00:00 0.49503…
11 01-701-1… XANO… 2013-07-19 00:00:00 Day 1  16h … 2013-07-19 16:00:00 0.13792…
12 01-701-1… XANO… 2013-07-19 00:00:00 Day 2  24h … 2013-07-20 00:00:00 0.01070…
13 01-701-1… XANO… 2013-07-19 00:00:00 Day 2  36h … 2013-07-20 12:00:00 <BLQ    
14 01-701-1… XANO… 2013-07-19 00:00:00 Day 3  48h … 2013-07-21 00:00:00 <BLQ    

Find Previous Dose

adppk_prev <- adppk_first_dose %>%
  derive_vars_joined(
    dataset_add = ex_exp,
    by_vars = exprs(USUBJID),
    order = exprs(ADTM),
    new_vars = exprs(
      ADTM_prev = ADTM, EXDOSE_prev = EXDOSE, AVISIT_prev = AVISIT,
      AENDTM_prev = AENDTM
    ),
    join_vars = exprs(ADTM),
    filter_add = NULL,
    filter_join = ADTM > ADTM.join,
    mode = "last",
    check_type = "none"
  )
# A tibble: 14 × 6
   USUBJID     ADTM                AVISIT PCTPT  ADTM_prev           AVISIT_prev
   <chr>       <dttm>              <chr>  <chr>  <dttm>              <chr>      
 1 01-701-1028 2013-07-18 23:30:00 Day 1  Pre-d… NA                  <NA>       
 2 01-701-1028 2013-07-19 00:05:00 Day 1  5 Min… 2013-07-19 00:00:00 Day 1      
 3 01-701-1028 2013-07-19 00:30:00 Day 1  30 Mi… 2013-07-19 00:00:00 Day 1      
 4 01-701-1028 2013-07-19 01:00:00 Day 1  1h Po… 2013-07-19 00:00:00 Day 1      
 5 01-701-1028 2013-07-19 01:30:00 Day 1  1.5h … 2013-07-19 00:00:00 Day 1      
 6 01-701-1028 2013-07-19 02:00:00 Day 1  2h Po… 2013-07-19 00:00:00 Day 1      
 7 01-701-1028 2013-07-19 04:00:00 Day 1  4h Po… 2013-07-19 00:00:00 Day 1      
 8 01-701-1028 2013-07-19 06:00:00 Day 1  6h Po… 2013-07-19 00:00:00 Day 1      
 9 01-701-1028 2013-07-19 08:00:00 Day 1  8h Po… 2013-07-19 00:00:00 Day 1      
10 01-701-1028 2013-07-19 12:00:00 Day 1  12h P… 2013-07-19 00:00:00 Day 1      
11 01-701-1028 2013-07-19 16:00:00 Day 1  16h P… 2013-07-19 00:00:00 Day 1      
12 01-701-1028 2013-07-20 00:00:00 Day 2  24h P… 2013-07-19 00:00:00 Day 1      
13 01-701-1028 2013-07-20 12:00:00 Day 2  36h P… 2013-07-20 00:00:00 Day 2      
14 01-701-1028 2013-07-21 00:00:00 Day 3  48h P… 2013-07-20 00:00:00 Day 2      

Find Previous Nominal Dose

adppk_nom_prev <- adppk_prev %>%
  derive_vars_joined(
    dataset_add = ex_exp,
    by_vars = exprs(USUBJID),
    order = exprs(NFRLT),
    new_vars = exprs(NFRLT_prev = NFRLT),
    join_vars = exprs(NFRLT),
    filter_add = NULL,
    filter_join = NFRLT > NFRLT.join,
    mode = "last",
    check_type = "none"
  )
# A tibble: 15 × 4
   USUBJID     AVISIT NFRLT NFRLT_prev
   <chr>       <chr>  <dbl>      <dbl>
 1 01-701-1028 Day 1   0            NA
 2 01-701-1028 Day 1   0.08          0
 3 01-701-1028 Day 1   0.5           0
 4 01-701-1028 Day 1   1             0
 5 01-701-1028 Day 1   1.5           0
 6 01-701-1028 Day 1   2             0
 7 01-701-1028 Day 1   4             0
 8 01-701-1028 Day 1   6             0
 9 01-701-1028 Day 1   8             0
10 01-701-1028 Day 1  12             0
11 01-701-1028 Day 1  16             0
12 01-701-1028 Day 2  24             0
13 01-701-1028 Day 2  36            24
14 01-701-1028 Day 3  48            24
15 01-701-1033 Day 1   0            NA

Derive Covariates Using Metacore

#---- Derive Covariates ----
covar <- adsl %>%
  create_var_from_codelist(metacore, input_var = STUDYID, out_var = STUDYIDN) %>%
  create_var_from_codelist(metacore, input_var = SEX, out_var = SEXN) %>%
  create_var_from_codelist(metacore, input_var = RACE, out_var = RACEN) %>%
  create_var_from_codelist(metacore, input_var = ETHNIC, out_var = AETHNIC) %>%
  create_var_from_codelist(metacore, input_var = AETHNIC, out_var = AETHNICN) %>%
  create_var_from_codelist(metacore, input_var = ARMCD, out_var = COHORT) %>%
  create_var_from_codelist(metacore, input_var = ARMCD, out_var = COHORTC) %>%
  create_var_from_codelist(metacore, input_var = COUNTRY, out_var = COUNTRYN) %>%
  create_var_from_codelist(metacore, input_var = COUNTRY, out_var = COUNTRYL) %>%
  mutate(
    STUDYIDN = as.numeric(word(USUBJID, 1, sep = fixed("-"))),
    SITEIDN = as.numeric(word(USUBJID, 2, sep = fixed("-"))),
    USUBJIDN = as.numeric(word(USUBJID, 3, sep = fixed("-"))),
    SUBJIDN = as.numeric(SUBJID),
    ROUTE = unique(ex$EXROUTE),
    FORM = unique(ex$EXDOSFRM),
    REGION1 = COUNTRY,
    REGION1N = COUNTRYN,
    SUBJTYPC = "Volunteer",
  ) %>%
  create_var_from_codelist(metacore, input_var = FORM, out_var = FORMN) %>%
  create_var_from_codelist(metacore, input_var = ROUTE, out_var = ROUTEN) %>%
  create_var_from_codelist(metacore, input_var = SUBJTYPC, out_var = SUBJTYP)
# A tibble: 15 × 8
   STUDYID      STUDYIDN USUBJID     USUBJIDN SEX    SEXN RACE  RACEN
   <chr>           <dbl> <chr>          <dbl> <chr> <dbl> <chr> <dbl>
 1 CDISCPILOT01        1 01-701-1015     1015 F         2 WHITE     1
 2 CDISCPILOT01        1 01-701-1023     1023 M         1 WHITE     1
 3 CDISCPILOT01        1 01-701-1028     1028 M         1 WHITE     1
 4 CDISCPILOT01        1 01-701-1033     1033 M         1 WHITE     1
 5 CDISCPILOT01        1 01-701-1034     1034 F         2 WHITE     1
 6 CDISCPILOT01        1 01-701-1047     1047 F         2 WHITE     1
 7 CDISCPILOT01        1 01-701-1057     1057 F         2 WHITE     1
 8 CDISCPILOT01        1 01-701-1097     1097 M         1 WHITE     1
 9 CDISCPILOT01        1 01-701-1111     1111 F         2 WHITE     1
10 CDISCPILOT01        1 01-701-1115     1115 M         1 WHITE     1
11 CDISCPILOT01        1 01-701-1118     1118 M         1 WHITE     1
12 CDISCPILOT01        1 01-701-1130     1130 M         1 WHITE     1
13 CDISCPILOT01        1 01-701-1133     1133 F         2 WHITE     1
14 CDISCPILOT01        1 01-701-1145     1145 F         2 WHITE     1
15 CDISCPILOT01        1 01-701-1146     1146 F         2 WHITE     1

Calculate Additional Covariates from Vital Signs and Labs

covar_vslb <- covar %>%
  derive_vars_merged(
    dataset_add = vs,
    filter_add = VSTESTCD == "HEIGHT",
    by_vars = exprs(STUDYID, USUBJID),
    new_vars = exprs(HTBL = VSSTRESN)
  ) %>%
  derive_vars_merged(
    dataset_add = vs,
    filter_add = VSTESTCD == "WEIGHT" & VSBLFL == "Y",
    by_vars = exprs(STUDYID, USUBJID),
    new_vars = exprs(WTBL = VSSTRESN)
  ) %>%
  derive_vars_transposed(
    dataset_merge = labsbl,
    by_vars = exprs(STUDYID, USUBJID),
    key_var = LBTESTCDB,
    value_var = LBSTRESN
  ) %>%
  mutate(
    BMIBL = compute_bmi(height = HTBL, weight = WTBL),
    BSABL = compute_bsa(
      height = HTBL,
      weight = HTBL,
      method = "Mosteller"
    ),
    CRCLBL = compute_egfr(
      creat = CREATBL, creatu = "SI", age = AGE, weight = WTBL, sex = SEX,
      method = "CRCL"
    ),
    EGFRBL = compute_egfr(
      creat = CREATBL, creatu = "SI", age = AGE, weight = WTBL, sex = SEX,
      method = "CKD-EPI"
    )
  ) %>%
  rename(TBILBL = BILIBL)
# A tibble: 15 × 9
   USUBJID     USUBJIDN  WTBL  HTBL BMIBL BSABL CREATBL CRCLBL EGFRBL
   <chr>          <dbl> <dbl> <dbl> <dbl> <dbl>   <dbl>  <dbl>  <dbl>
 1 01-701-1015     1015  54.4  147.  25.1  2.46    79.6   54.8   71.9
 2 01-701-1023     1023  80.3  163.  30.4  2.71   124.    60.6   56.1
 3 01-701-1028     1028  99.3  178.  31.4  2.96   124.    68.1   53.7
 4 01-701-1033     1033  88.4  175.  28.8  2.92   133.    54.2   48.6
 5 01-701-1034     1034  62.6  155.  26.1  2.58    88.4   46.4   58.0
 6 01-701-1047     1047  67.1  149.  30.4  2.48    88.4   43.4   55.2
 7 01-701-1057     1057  NA     NA   NA   NA       NA     NA     NA  
 8 01-701-1097     1097  78.0  169.  27.3  2.82   124.    55.8   54.8
 9 01-701-1111     1111  59.9  158.  23.9  2.64    79.6   46.2   64.2
10 01-701-1115     1115  78.9  182.  23.9  3.03   115.    47.3   54.2
11 01-701-1118     1118  71.2  180.  21.9  3.01    88.4   87.2   90.6
12 01-701-1130     1130  79.4  170.  27.6  2.83   124.    44.2   49.6
13 01-701-1133     1133  74.4  163.  28.2  2.71    97.2   46.9   50.5
14 01-701-1145     1145  NA     NA   NA   NA       NA     NA     NA  
15 01-701-1146     1146  54.0  147.  24.9  2.46    79.6   45.9   66.7

{metacore} Checks

adppk <- adppk_prefinal %>%
  drop_unspec_vars(metacore) %>% # Drop unspecified variables from specs
  check_variables(metacore) %>% # Check all variables specified are present and no more
  check_ct_data(metacore) %>% # Checks all variables with CT only contain values within the CT
  order_cols(metacore) %>% # Orders the columns according to the spec
  sort_by_key(metacore) # Sorts the rows by the sort keys

{xportr} Steps

adppk_xpt <- adppk %>%
  xportr_type(metacore) %>% # Coerce variable type to match spec
  xportr_length(metacore) %>% # Assigns SAS length from a variable level metadata
  xportr_label(metacore) %>% # Assigns variable label from metacore specifications
  xportr_format(metacore) %>% # Assigns variable format from metacore specifications
  xportr_df_label(metacore) %>% # Assigns dataset label from metacore specifications
  xportr_write(file.path(dir, "adppk.xpt")) # Write xpt v5 transport file
       USUBJID EVID NFRLT NPRLT       AFRLT       APRLT         DV
1  01-701-1028    0  0.00  0.00 -0.50000000 -0.50000000 0.00000000
2  01-701-1028    1  0.00  0.00  0.00000000  0.00000000         NA
3  01-701-1028    0  0.08  0.08  0.08333333  0.08333333 0.10156622
4  01-701-1028    0  0.50  0.50  0.50000000  0.50000000 0.54690177
5  01-701-1028    0  1.00  1.00  1.00000000  1.00000000 0.92546539
6  01-701-1028    0  1.50  1.50  1.50000000  1.50000000 1.18750588
7  01-701-1028    0  2.00  2.00  2.00000000  2.00000000 1.36888945
8  01-701-1028    0  4.00  4.00  4.00000000  4.00000000 1.68314758
9  01-701-1028    0  6.00  6.00  6.00000000  6.00000000 1.75529232
10 01-701-1028    0  8.00  8.00  8.00000000  8.00000000 1.77185470
11 01-701-1028    0 12.00 12.00 12.00000000 12.00000000 0.49503585
12 01-701-1028    0 16.00 16.00 16.00000000 16.00000000 0.13792316
13 01-701-1028    0 24.00 24.00 24.00000000 24.00000000 0.01070627
14 01-701-1028    1 24.00  0.00 24.00000000  0.00000000         NA
15 01-701-1028    0 36.00 12.00 36.00000000 12.00000000         NA
16 01-701-1028    0 48.00 24.00 48.00000000 24.00000000         NA
17 01-701-1028    1 48.00  0.00 48.00000000  0.00000000         NA
18 01-701-1033    0  0.00  0.00 -0.50000000 -0.50000000 0.00000000
19 01-701-1033    1  0.00  0.00  0.00000000  0.00000000         NA
20 01-701-1033    0  0.08  0.08  0.08333333  0.08333333 0.10052550

Summary

Thank You!

  • {admiral} Core Team
  • Slack Pharmaverse PK Working Group
  • Luke Reinbolt
  • Ben Straub

Questions

Contact