-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
94 refactor #95
94 refactor #95
Conversation
…le-subtitle-and-footnotes@main
Minimum allowed coverage is Generated by 🐒 cobertura-action against d2f647e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' | ||
#' aet02_1(adsl, adae) | ||
#' aet02_1(adsl, adae, lbl_overall = "All Patients") | ||
#' db <- syn_test_data() %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the syn_test_data
makes the examples easier, we should add the preprocessing that is needed for other examples as well
#' aet02_1(adsl, adae) | ||
#' db <- db %>% | ||
#' (std_filter("aet02_1"))() %>% | ||
#' (std_mutate("aet02_1"))() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standard filter and mutation
#' | ||
#' aet02_1(db_m) %>% head() | ||
#' | ||
aet02_1 <- function(adam_db, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now functions require an adam_db
argument which is either a named list or a dm
object
R/aet02.R
Outdated
@@ -41,28 +58,20 @@ aet02_1 <- function(adsl, adae, | |||
lbl_overall = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this should be NA
or NULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL
seems to be good
lbl_AEBODSYS = "AEBODSYS", | ||
lbl_AEDECOD = "AEDECOD", | ||
lbl_AEBODSYS = "Body System or Organ Class", | ||
lbl_AEDECOD = "Dictionary-Derived Term", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be taken from the standards, i.e. check on bee
with
library(rgdsr)
rgdsr::adamv_var_info("AEBODSYS")
lbl_AEDECOD = lbl_AEDECOD, | ||
lbl_AEBODSYS = var_labels_for(adae, "AEBODSYS"), | ||
lbl_AEHLT = var_labels_for(adae, "AEHLT"), | ||
lbl_AEDECOD = var_labels_for(adae, "AEDECOD"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as these labels are nowhere else used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we keep these parameters in the layout function? Is it because we expect users can use the layout function if the main template function doesn't meet the need?
@@ -0,0 +1,11 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please have a look at this code
R/dmt01.R
Outdated
@@ -38,7 +43,7 @@ | |||
#' summaryvars = c("AGE", "RACE", "SEX"), | |||
#' summaryvars_lbls = c("Age (yr)", "Race", "Sex")) | |||
#' | |||
dmt01_1 <- function(ad_bl, | |||
dmt01_1 <- function(data, dataname = "adsl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be discussed this afternoon
dmt01_1 <- function(data, dataname = "adsl", | |
dmt01_1 <- function(adam_db, dataname = "adsl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how baseline information from dataset adsub
is addressed in adam_db
? In study level preprocessing, or in chevron
?
"aet02_1", "filter_adae_anl01fl", NA, c("adsl", "adae"), | ||
"aet02_2", "filter_adae_anl01fl", NA, c("adsl", "adae"), | ||
"aet02_3", "filter_adae_anl01fl", NA, c("adsl", "adae") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every new chevron
function needs an entry here
ifelse_layout <- function(lyt, test, fun_lyt_yes = identity, fun_lyt_no = identity) { | ||
|
||
assert_that(length(test) == 1, is.logical(test)) | ||
|
||
if (test) | ||
fun_lyt_yes(lyt) | ||
else | ||
fun_lyt_no(lyt) | ||
} | ||
|
||
lyt_fun <- function(fun, ...) { | ||
function(lyt) { | ||
fun(lyt, ...) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifelse_layout <- function(lyt, test, fun_lyt_yes = identity, fun_lyt_no = identity) { | |
assert_that(length(test) == 1, is.logical(test)) | |
if (test) | |
fun_lyt_yes(lyt) | |
else | |
fun_lyt_no(lyt) | |
} | |
lyt_fun <- function(fun, ...) { | |
function(lyt) { | |
fun(lyt, ...) | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not needed anymore
R/utils.R
Outdated
db_m <- db %>% | ||
dm_zoom_to(adae) %>% | ||
mutate(ANL01FL = 'Y') %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this code in syn_test_data
?
db <- new_dm(sd) %>% | ||
dm_add_pk(adsl, c("USUBJID", "STUDYID")) %>% | ||
dm_add_fk(adae, c("USUBJID", "STUDYID"), ref_table = "adsl") %>% | ||
dm_add_pk(adae, "AESEQ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be dm_add_pk(adae, c("STUDYID", "USUBJID", "AESEQ")
?
eliminate intermediate variables rename arg
Please have a look at
aet02.R