diff --git a/R/radab.R b/R/radab.R index b4c12b77..0584660e 100644 --- a/R/radab.R +++ b/R/radab.R @@ -386,6 +386,14 @@ radab <- function(adsl, last_ada )) + # Carry over ARM and ACTARM for all records. + arm <- adab %>% + filter(!is.na(ARM), !is.na(ACTARM)) %>% + select(USUBJID, ARM, ACTARM) %>% + distinct(.) + adab$ARM <- arm$ARM[match(adab$USUBJID, arm$USUBJID)] + adab$ACTARM <- arm$ACTARM[match(adab$USUBJID, arm$USUBJID)] + if (length(na_vars) > 0 && na_percentage > 0) { adab <- mutate_na(ds = adab, na_vars = na_vars, na_percentage = na_percentage) } diff --git a/data/cadab.RData b/data/cadab.RData index fd641cff..b2622699 100644 Binary files a/data/cadab.RData and b/data/cadab.RData differ diff --git a/tests/testthat/_snaps/row_values.md b/tests/testthat/_snaps/row_values.md index 8a6c6de9..60a5bbfe 100644 --- a/tests/testthat/_snaps/row_values.md +++ b/tests/testthat/_snaps/row_values.md @@ -4698,24 +4698,24 @@ 6 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 24H 1.08 7 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X Predose 1 8 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 24H 1 - 9 AB12345 AB12345-JPN-4-id-7 1 - 10 AB12345 AB12345-JPN-4-id-7 0 - 11 AB12345 AB12345-JPN-4-id-7 0 - 12 AB12345 AB12345-JPN-4-id-7 1 - 13 AB12345 AB12345-JPN-4-id-7 1 - 14 AB12345 AB12345-JPN-4-id-7 0 - 15 AB12345 AB12345-JPN-4-id-7 0 - 16 AB12345 AB12345-JPN-4-id-7 1 - 17 AB12345 AB12345-JPN-4-id-7 1 - 18 AB12345 AB12345-JPN-4-id-7 1 - 19 AB12345 AB12345-JPN-4-id-7 0 - 20 AB12345 AB12345-JPN-4-id-7 0 - 21 AB12345 AB12345-JPN-4-id-7 1 - 22 AB12345 AB12345-JPN-4-id-7 0 - 23 AB12345 AB12345-JPN-4-id-7 1 - 24 AB12345 AB12345-JPN-4-id-7 1 - 25 AB12345 AB12345-JPN-4-id-7 0 - 26 AB12345 AB12345-JPN-4-id-7 0.143 + 9 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 10 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 11 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 12 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 13 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 14 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 15 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 16 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 17 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 18 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 19 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 20 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 21 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 22 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 23 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 24 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 + 25 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0 + 26 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 0.143 AVALC AVALU 1 POSITIVE "titer" @@ -4837,16 +4837,16 @@ # A tibble: 10 x 21 STUDYID USUBJID ARM ACTARM ISTPT AVAL - 1 AB12345 AB12345-USA-13-id-3 0 + 1 AB12345 AB12345-USA-13-id-3 A: Drug X A: Drug X 0 2 AB12345 AB12345-CHN-3-id-5 A: Drug X A: Drug X 24H NA - 3 AB12345 AB12345-BRA-9-id-8 1 + 3 AB12345 AB12345-BRA-9-id-8 A: Drug X A: Drug X 1 4 AB12345 AB12345-CHN-11-id-1 C: Combination C: Combination 24H NA - 5 AB12345 AB12345-BRA-9-id-8 0 + 5 AB12345 AB12345-BRA-9-id-8 A: Drug X A: Drug X 0 6 AB12345 AB12345-CHN-3-id-5 A: Drug X A: Drug X Predose 1 - 7 AB12345 AB12345-BRA-1-id-9 0.143 - 8 AB12345 AB12345-CHN-11-id-1 0 - 9 AB12345 AB12345-USA-13-id-3 1 - 10 AB12345 AB12345-JPN-4-id-7 1 + 7 AB12345 AB12345-BRA-1-id-9 C: Combination C: Combination 0.143 + 8 AB12345 AB12345-CHN-11-id-1 C: Combination C: Combination 0 + 9 AB12345 AB12345-USA-13-id-3 A: Drug X A: Drug X 1 + 10 AB12345 AB12345-JPN-4-id-7 A: Drug X A: Drug X 1 AVALC AVALU PARAM 1 N "" Treatment enhanced ADA, Neutralizing Antibody