-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathadppk.qmd
More file actions
631 lines (531 loc) · 17.8 KB
/
adppk.qmd
File metadata and controls
631 lines (531 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
---
title: "ADPPK"
order: 7
---
```{r setup script, include=FALSE, purl=FALSE}
invisible_hook_purl <- function(before, options, ...) {
knitr::hook_purl(before, options, ...)
NULL
}
knitr::knit_hooks$set(purl = invisible_hook_purl)
source("functions/print_df.R")
```
The Population PK Analysis Data (ADPPK) follows the CDISC Implementation Guide (<https://www.cdisc.org/standards/foundational/adam/basic-data-structure-adam-poppk-implementation-guide-v1-0>). Population PK models generally make use of nonlinear mixed effects models that require numeric variables. The data used in the models will include both dosing and concentration records, relative time variables, and numeric covariate variables. A `DV` or dependent variable is often expected. For more details see the `{admiral}` [vignette](https://pharmaverse.github.io/admiral/articles/pk_adnca.html){target="_blank"}.
## First Load Packages
First we will load the packages required for our project. We will use `{admiral}` for the creation of analysis data. `{admiral}` requires `{dplyr}`, `{lubridate}` and `{stringr}`. Find other `{admiral}` functions and related variables by searching [admiraldiscovery](<https://pharmaverse.github.io/admiraldiscovery/articles/reactable.html>). We will use `{metacore}` and `{metatools}` to store and manipulate metadata from our specifications. We will use `{xportr}` to perform checks on the final data and export to a transport file.
The source SDTM data will come from the CDISC pilot study data stored in `{pharmaversesdtm}`.
```{r echo=TRUE, message=FALSE}
#| label: Load Packages
# Load Packages
library(admiral)
library(dplyr)
library(lubridate)
library(stringr)
library(metacore)
library(metatools)
library(xportr)
library(readr)
library(pharmaversesdtm)
library(pharmaverseadam)
```
## Next Load Specifications for Metacore
We have saved our specifications in an Excel file and will load them into `{metacore}` with the `metacore::spec_to_metacore()` function.
```{r echo=TRUE, message=FALSE}
#| label: Load Specs
#| warning: false
# ---- Load Specs for Metacore ----
metacore <- spec_to_metacore("./metadata/pk_spec.xlsx") %>%
select_dataset("ADPPK")
```
## Load Source Datasets
We will load are SDTM data from `{pharmaversesdtm}`. The main components of this will be exposure data from `EX` and pharmacokinetic concentration data from `PC`. We will use `ADSL` for baseline characteristics and we will derive additional baselines from vital signs `VS` and laboratory data `LB`.
```{r}
#| label: Load Source
# ---- Load source datasets ----
# Load PC, EX, VS, LB and ADSL
ex <- pharmaversesdtm::ex
pc <- pharmaversesdtm::pc
vs <- pharmaversesdtm::vs
lb <- pharmaversesdtm::lb
adsl <- pharmaverseadam::adsl
ex <- convert_blanks_to_na(ex)
pc <- convert_blanks_to_na(pc)
vs <- convert_blanks_to_na(vs)
lb <- convert_blanks_to_na(lb)
```
## Derivations
### Derive PC Dates
Here we use `{admiral}` functions for working with dates and we will also create a nominal time from first dose `NFRLT` for `PC` data using `derive_var_nfrlt()`.
```{r}
#| label: PC Dates
# ---- Derivations ----
# Get list of ADSL vars required for derivations
adsl_vars <- exprs(TRTSDT, TRTSDTM, TRT01P, TRT01A)
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",
ignore_seconds_flag = FALSE
) %>%
# 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
) %>%
derive_var_nfrlt(
new_var = NFRLT,
new_var_unit = FRLTU,
out_unit = "HOURS",
tpt_var = PCTPT,
visit_day = VISITDY
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(pc_dates %>% select(USUBJID, PCTEST, ADTM, VISIT, PCTPT, NFRLT))
```
### Get Dosing Information
Here we also create nominal time from first dose `NFRLT` for `EX` data based on `VISITDY` using `derive_var_nfrlt()`.
```{r}
#| label: Dosing
# ---- Get dosing information ----
ex_dates <- ex %>%
derive_vars_merged(
dataset_add = adsl,
new_vars = adsl_vars,
by_vars = exprs(STUDYID, USUBJID)
) %>%
# Keep records with nonzero dose
filter(EXDOSE > 0) %>%
# Add time and set missing end date to start date
# Impute missing time to 00:00:00
# Note all times are missing for dosing records in this example data
# Derive Analysis Start and End Dates
derive_vars_dtm(
new_vars_prefix = "AST",
dtc = EXSTDTC,
time_imputation = "00:00:00"
) %>%
derive_vars_dtm(
new_vars_prefix = "AEN",
dtc = EXENDTC,
time_imputation = "00:00:00"
) %>%
# Derive event ID and nominal relative time from first dose (NFRLT)
mutate(
EVID = 1
) %>%
derive_var_nfrlt(
new_var = NFRLT,
new_var_unit = FRLTU,
out_unit = "HOURS",
visit_day = VISITDY
) %>%
# Set missing end dates to start date
mutate(AENDTM = case_when(
is.na(AENDTM) ~ ASTDTM,
TRUE ~ AENDTM
)) %>%
# Derive dates from date/times
derive_vars_dtm_to_dt(exprs(ASTDTM)) %>%
derive_vars_dtm_to_dt(exprs(AENDTM))
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(ex_dates %>% select(
USUBJID, EXTRT, EXDOSFRQ, EXSTDTC, EXENDTC, VISIT, VISITDY
))
```
### Expand Dosing Records
Since there is a start date and end date for dosing records we need to expand the dosing records between the start date and end date using the function `admiral::create_single_dose_dataset()`.
```{r}
#| label: Expand
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))
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(
ex_exp %>% select(USUBJID, DRUG, EXDOSFRQ, ASTDT, AVISIT, NFRLT)
)
```
### Find First Dose
In this section we will find the first dose for each subject and drug.
```{r}
#| label: First Dose
# ---- Find first dose per treatment per subject ----
# ---- Join with ADPPK data and keep only subjects with dosing ----
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),
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(adppk_first_dose %>% select(USUBJID, FANLDTM, NFRLT, ADTM, AVISITN, AVISIT, PCTPT))
```
### Find Previous Dose
For `ADPPK` we will find the previous dose with respect to actual time and nominal time.
```{r}
#| label: Previous Dose
# ---- 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),
join_type = "all",
filter_add = NULL,
filter_join = ADTM > ADTM.join,
mode = "last",
check_type = "none"
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(adppk_prev %>% select(USUBJID, VISIT, ADTM, VISIT, PCTPT, ADTM_prev, AVISIT_prev))
```
### Find Previous Nominal Dose
```{r}
#| label: 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),
join_type = "all",
filter_add = NULL,
filter_join = NFRLT > NFRLT.join,
mode = "last",
check_type = "none"
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(adppk_nom_prev %>% select(USUBJID, VISIT, ADTM, NFRLT, NFRLT_prev))
```
### Combine PC and EX Data
Here we combine `PC` and `EX` records. We will derive the relative time variables `AFRLT` (Actual Relative Time from First Dose), `APRLT` (Actual Relative Time from Previous Dose), and `NPRLT` (Nominal Relative Time from Previous Dose).
```{r}
#| label: Combine
adppk_aprlt <- bind_rows(adppk_nom_prev, ex_exp) %>%
group_by(USUBJID, DRUG) %>%
mutate(
FANLDTM = min(FANLDTM, na.rm = TRUE),
min_NFRLT = min(NFRLT, na.rm = TRUE),
maxdate = max(ADT[EVID == 0], na.rm = TRUE), .after = USUBJID
) %>%
arrange(USUBJID, ADTM) %>%
ungroup() %>%
filter(ADT <= maxdate) %>%
# Derive Actual Relative Time from First Dose (AFRLT)
derive_vars_duration(
new_var = AFRLT,
start_date = FANLDTM,
end_date = ADTM,
out_unit = "HOURS",
floor_in = FALSE,
add_one = FALSE
) %>%
# Derive Actual Relative Time from Reference Dose (APRLT)
derive_vars_duration(
new_var = APRLT,
start_date = ADTM_prev,
end_date = ADTM,
out_unit = "HOURS",
floor_in = FALSE,
add_one = FALSE
) %>%
# Derive APRLT
mutate(
APRLT = case_when(
EVID == 1 ~ 0,
is.na(APRLT) ~ AFRLT,
TRUE ~ APRLT
),
NPRLT = case_when(
EVID == 1 ~ 0,
is.na(NFRLT_prev) ~ NFRLT - min_NFRLT,
TRUE ~ NFRLT - NFRLT_prev
)
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(adppk_aprlt %>% select(USUBJID, FANLDTM, AVISIT, PCTPT, APRLT, NPRLT))
```
### Derive Analysis Variables
The expected analysis variable for `ADPPK` is `DV` or dependent variable. For this example `DV` is set to the numeric concentration value `PCSTRESN`. We will also include `AVAL` equivalent to `DV` for consistency with CDISC ADaM standards. `MDV` missing dependent variable will also be included.
```{r}
#| label: Analysis Variables
# ---- Derive Analysis Variables ----
# Derive actual dose DOSEA and planned dose DOSEP,
# Derive AVAL and DV
adppk_aval <- adppk_aprlt %>%
mutate(
# Derive Actual Dose
DOSEA = case_when(
EVID == 1 ~ EXDOSE,
is.na(EXDOSE_prev) ~ EXDOSE_first,
TRUE ~ EXDOSE_prev
),
# Derive Planned Dose
DOSEP = case_when(
TRT01P == "Xanomeline High Dose" ~ 81,
TRT01P == "Xanomeline Low Dose" ~ 54,
TRT01P == "Placebo" ~ 0
),
# Derive PARAMCD
PARAMCD = case_when(
EVID == 1 ~ "DOSE",
TRUE ~ PCTESTCD
),
ALLOQ = PCLLOQ,
# Derive CMT
CMT = case_when(
EVID == 1 ~ 1,
PCSPEC == "PLASMA" ~ 2,
TRUE ~ 3
),
# Derive BLQFL/BLQFN
BLQFL = case_when(
PCSTRESC == "<BLQ" ~ "Y",
TRUE ~ "N"
),
BLQFN = case_when(
PCSTRESC == "<BLQ" ~ 1,
TRUE ~ 0
),
AMT = case_when(
EVID == 1 ~ EXDOSE,
TRUE ~ NA_real_
),
# Derive DV and AVAL
DV = PCSTRESN,
DVID = PCTESTCD,
AVAL = DV,
DVL = case_when(
DV != 0 ~ log(DV),
TRUE ~ NA_real_
),
# Derive MDV
MDV = case_when(
EVID == 1 ~ 1,
is.na(DV) ~ 1,
TRUE ~ 0
),
AVALU = case_when(
EVID == 1 ~ NA_character_,
TRUE ~ PCSTRESU
),
RLTU = "h",
USTRESC = PCSTRESC,
UDTC = format_ISO8601(ADTM),
II = if_else(EVID == 1, 1, 0),
SS = if_else(EVID == 1, 1, 0),
ADDL = 0,
OCC = 1,
)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(adppk_aval %>% select(USUBJID, AVISIT, EVID, NFRLT, DV))
```
### Add ASEQ
```{r}
#| label: ASEQ
# ---- Add ASEQ ----
adppk_aseq <- adppk_aval %>%
# Calculate ASEQ
derive_var_obs_number(
new_var = ASEQ,
by_vars = exprs(STUDYID, USUBJID),
order = exprs(AFRLT, EVID, CMT),
check_type = "error"
) %>%
mutate(
PROJID = DRUG,
PROJIDN = 1,
PART = 1,
)
```
## Derive Covariates Using `{metatools}`
In this step we will create our numeric covariates using the `metatools::create_var_from_codelist()` function.
```{r}
#| label: Covariates
# ---- Derive Covariates ----
# Include numeric values for STUDYIDN, USUBJIDN, SEXN, RACEN etc.
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)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(covar %>% select(USUBJID, SEX, SEXN, RACE, RACEN))
```
### Derive Additional Baselines
Next we add additional baselines from vital signs and laboratory data.
```{r}
#| label: Baselines
labsbl <- lb %>%
filter(LBBLFL == "Y" & LBTESTCD %in% c("CREAT", "ALT", "AST", "BILI")) %>%
mutate(LBTESTCDB = paste0(LBTESTCD, "BL")) %>%
select(STUDYID, USUBJID, LBTESTCDB, LBSTRESN)
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 = WTBL,
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)
```
```{r eval=TRUE, echo=FALSE, purl=FALSE}
print_df(covar_vslb %>% select(USUBJID, WTBL, HTBL, BMIBL, CRCLBL))
```
### Combine with Covariates
We combine our covariates with the rest of the data
```{r}
#| label: Combine with Covariates
# Combine covariates with APPPK data
adppk_prefinal <- adppk_aseq %>%
derive_vars_merged(
dataset_add = select(covar_vslb, !!!negate_vars(adsl_vars)),
by_vars = exprs(STUDYID, USUBJID)
) %>%
arrange(STUDYIDN, USUBJIDN, AFRLT, EVID) %>%
# Add RECSEQ
# Exclude records if needed
mutate(
RECSEQ = row_number(),
EXCLFCOM = "None"
) %>%
create_var_from_codelist(metacore, input_var = DVID, out_var = DVIDN, strict = FALSE) %>%
create_var_from_codelist(metacore, input_var = EXCLFCOM, out_var = EXCLF)
```
## Check Data With metacore and metatools
We use `{metacore}` objects with `{metatools}` functions to perform a number of checks on the data. We will drop variables not in the specs and make sure all the variables from the specs are included.
```{r}
#| label: Metacore
#| warning: false
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
```
## Apply Labels and Formats with xportr
Using {xportr} we check variable type, assign variable length, add variable labels, add variable formats, and save a transport file with `xportr::xportr_write()`.
```{r}
#| label: xportr
dir <- tempdir() # Change to whichever directory you want to save the dataset in
adppk_xpt <- adppk %>%
xportr_type(metacore, domain = "ADPPK") %>% # 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
```