Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

adab refactoring #154 #168

Merged
merged 4 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
### Bug fix
* Update all the NA and "" to "" in `ADAE$ANL01FL`.
* Updated `DVDECOD` and `DVSCAT` values in ADDV Dataset (`raddv`, `caddv`).
* Included post-baseline visits to `radab`

### Enhancements
* Enhanced `radpp` with additional default `PARAM`s.
* Add new variables `PPSTINT` `PPENINT` `REGIMEN` `PKARMCD` to `radpp`.
* Enhanced `radab` variables `ADAPBLFL`, `ABLFL`, `ADABLFL`, `PARCAT1`, `RELTMU`
* Add new variable `lgTMATRSK` to `adtte`.
* Add `TNE` to `PARAMCD` and `Total Number of Exacerbations` to `PARAM` in `adtte`.

Expand Down
21 changes: 15 additions & 6 deletions R/radab.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ radab <- function(ADSL, # nolint
USUBJID = unique(ADSL$USUBJID),
VISIT = unique(ADPC$VISIT),
PARAM = as.factor(param_init_list$relvar1),
PARCAT1 = paste(unique(ADSL$ARM), "Antibody"),
PCTPT = "Predose",
PARCAT1 = "A: Drug X Antibody",
PCTPT = unique(ADPC$PCTPT),
stringsAsFactors = FALSE
)

Expand All @@ -85,10 +85,7 @@ radab <- function(ADSL, # nolint
(PARAM == "Antibody titer units" & !is.na(AVAL2)) ~ AVAL2,
TRUE ~ as.numeric(NA)
),
ISTPT = "Predose",
ADABLFL = "Y",
ADAPBLFL = "Y",
ABLFL = "Y"
ISTPT = "Predose"
) %>%
dplyr::select(-c(AVAL1, AVAL2))

Expand Down Expand Up @@ -131,5 +128,17 @@ radab <- function(ADSL, # nolint
ADAB <- mutate_na(ds = ADAB, na_vars = na_vars, na_percentage = na_percentage) # nolint
}

# mutate time from dose variables from ADPC to convert into Days
ADAB <- ADAB %>% dplyr::mutate_at(c("ARELTM1", "NRELTM1", "ARELTM2", "NRELTM2"), ~ . / 24) # nolint
ADAB <- ADAB %>% dplyr::mutate( # nolint
RELTMU = "day", # nolint
ADABLFL = "Y",
ADAPBLFL = ifelse(ACTARM == "A: Drug X" | ACTARM == "C: Combination", "Y",
NA
),
ABLFL = ifelse(NRELTM1 == 0, "Y", NA)
)


ADAB <- apply_metadata(ADAB, "metadata/ADAB.yml") # nolint
}
Binary file modified data/cadab.RData
Binary file not shown.
3 changes: 3 additions & 0 deletions inst/metadata/ADAB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ variables:
ABLFL:
label: Baseline Record Flag
type: factor
RELTMU:
label: Relative Actual/Nominal Time Units
type: factor
2 changes: 1 addition & 1 deletion man/cadab.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.