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

Closes #45 replace format_* functions #49

Merged
merged 5 commits into from
Jan 25, 2023
Merged
Changes from 1 commit
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
19 changes: 9 additions & 10 deletions submission/programs/adsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ adsl00 <- dm %>%
# distinct(adsl_prod[which(adsl_prod$SITEGR1 == "900"), c("SITEID", "SITEGR1")])

adsl01 <- adsl00 %>%
create_cat_var(adsl_spec, AGE, AGEGR1, AGEGR1N) %>% # replace format_agegr1/format_agegr1n
create_var_from_codelist(adsl_spec, RACE, RACEN) %>% # replace format_racen

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the comments #replace format_ everywhere?

mutate(
SITEGR1 = format_sitegr1(SITEID),
AGEGR1 = format_agegr1(AGE),
AGEGR1N = format_agegr1n(AGE),
RACEN = format_racen(RACE)
SITEGR1 = format_sitegr1(SITEID)
)

# Population flag ---------------------------------------------------------
Expand Down Expand Up @@ -227,10 +226,10 @@ vs00 <- vs %>%
select(STUDYID, USUBJID, VSTESTCD, AVAL) %>%
pivot_wider(names_from = VSTESTCD, values_from = AVAL, names_glue = "{VSTESTCD}BL") %>%
mutate(
BMIBL = round(WEIGHTBL / (HEIGHTBL / 100)^2, digits = 1),
BMIBLGR1 = format_bmiblgr1(BMIBL)
)

BMIBL = round(WEIGHTBL / (HEIGHTBL / 100)^2, digits = 1)
) %>%
create_cat_var(adsl_spec, BMIBL, BMIBLGR1) #replace format_bmiblgr1
sc00 <- sc %>%
filter(SCTESTCD == "EDLEVEL") %>%
select(STUDYID, USUBJID, SCTESTCD, SCSTRESN) %>%
Expand Down Expand Up @@ -279,9 +278,9 @@ adsl06 <- adsl05 %>%
add_one = TRUE
) %>%
mutate(
DURDIS = round(DURDIS, digits = 1),
DURDSGR1 = format_durdsgr1(DURDIS)
DURDIS = round(DURDIS, digits = 1)
) %>%
create_cat_var(adsl_spec, DURDIS, DURDSGR1) %>% # replace format_durdsgr1
derive_vars_dt(
dtc = RFENDTC,
new_vars_prefix = "RFEN",
Expand Down