From 4969902492f153fb342c0ee6ee8751c29a583205 Mon Sep 17 00:00:00 2001 From: Zelos Zhu Date: Fri, 23 Aug 2024 19:38:23 +0000 Subject: [PATCH] does this work? --- R/derive_params_growth_age.R | 4 ++-- R/derive_params_growth_height.R | 6 +++--- data-raw/adsl_peds.R | 2 +- inst/templates/ad_advs.R | 3 ++- man/derive_params_growth_age.Rd | 4 ++-- man/derive_params_growth_height.Rd | 6 +++--- vignettes/advs.Rmd | 1 + 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/R/derive_params_growth_age.R b/R/derive_params_growth_age.R index c56b9b0..73174fa 100644 --- a/R/derive_params_growth_age.R +++ b/R/derive_params_growth_age.R @@ -118,9 +118,9 @@ #' library(admiral, warn.conflicts = FALSE) #' library(pharmaversesdtm, warn.conflicts = FALSE) #' -#' advs <- pharmaversesdtm::dm_peds %>% +#' advs <- dm_peds %>% #' select(USUBJID, BRTHDTC, SEX) %>% -#' right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") %>% +#' right_join(., vs_peds, by = "USUBJID") %>% #' mutate( #' VSDT = ymd(VSDTC), #' BRTHDT = ymd(BRTHDTC) diff --git a/R/derive_params_growth_height.R b/R/derive_params_growth_height.R index 89572ba..a937ee0 100644 --- a/R/derive_params_growth_height.R +++ b/R/derive_params_growth_height.R @@ -118,9 +118,9 @@ #' #' # derive weight for height/length only for those under 2 years old using WHO #' # weight for length reference file -#' advs <- pharmaversesdtm::dm_peds %>% +#' advs <- dm_peds %>% #' select(USUBJID, BRTHDTC, SEX) %>% -#' right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") %>% +#' right_join(., vs_peds, by = "USUBJID") %>% #' mutate( #' VSDT = ymd(VSDTC), #' BRTHDT = ymd(BRTHDTC) @@ -133,7 +133,7 @@ #' out_unit = "days" #' ) #' -#' heights <- pharmaversesdtm::vs_peds %>% +#' heights <- vs_peds %>% #' filter(VSTESTCD == "HEIGHT") %>% #' select(USUBJID, VSSTRESN, VSSTRESU, VSDTC) %>% #' rename( diff --git a/data-raw/adsl_peds.R b/data-raw/adsl_peds.R index 7300b74..8887a54 100644 --- a/data-raw/adsl_peds.R +++ b/data-raw/adsl_peds.R @@ -11,7 +11,7 @@ library(stringr) # Create a basic ADSL for pediatrics ---- # Read in input data ---- -dm_peds <- pharmaversesdtm::dm_peds +dm_peds <- dm_peds ex <- ex # Derivations ---- diff --git a/inst/templates/ad_advs.R b/inst/templates/ad_advs.R index ca4de25..0aae04a 100644 --- a/inst/templates/ad_advs.R +++ b/inst/templates/ad_advs.R @@ -10,6 +10,7 @@ # who_wt_for_lgth_boys, who_wt_for_lgth_girls library(admiral) +library(pharamversesdtm) library(admiralpeds) library(dplyr) library(lubridate) @@ -180,7 +181,7 @@ who_wt_for_lgth <- who_wt_for_lgth_boys %>% # as needed and assign to the variables below. # For illustration purposes read in admiral test data -vs_peds <- pharmaversesdtm::vs_peds +vs_peds <- vs_peds data("adsl_peds") vs <- vs_peds diff --git a/man/derive_params_growth_age.Rd b/man/derive_params_growth_age.Rd index b6a21e6..21544d0 100644 --- a/man/derive_params_growth_age.Rd +++ b/man/derive_params_growth_age.Rd @@ -132,9 +132,9 @@ library(rlang, warn.conflicts = FALSE) library(admiral, warn.conflicts = FALSE) library(pharmaversesdtm, warn.conflicts = FALSE) -advs <- pharmaversesdtm::dm_peds \%>\% +advs <- dm_peds \%>\% select(USUBJID, BRTHDTC, SEX) \%>\% - right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") \%>\% + right_join(., vs_peds, by = "USUBJID") \%>\% mutate( VSDT = ymd(VSDTC), BRTHDT = ymd(BRTHDTC) diff --git a/man/derive_params_growth_height.Rd b/man/derive_params_growth_height.Rd index 51f3513..d383bd6 100644 --- a/man/derive_params_growth_height.Rd +++ b/man/derive_params_growth_height.Rd @@ -131,9 +131,9 @@ library(pharmaversesdtm, warn.conflicts = FALSE) # derive weight for height/length only for those under 2 years old using WHO # weight for length reference file -advs <- pharmaversesdtm::dm_peds \%>\% +advs <- dm_peds \%>\% select(USUBJID, BRTHDTC, SEX) \%>\% - right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") \%>\% + right_join(., vs_peds, by = "USUBJID") \%>\% mutate( VSDT = ymd(VSDTC), BRTHDT = ymd(BRTHDTC) @@ -146,7 +146,7 @@ advs <- pharmaversesdtm::dm_peds \%>\% out_unit = "days" ) -heights <- pharmaversesdtm::vs_peds \%>\% +heights <- vs_peds \%>\% filter(VSTESTCD == "HEIGHT") \%>\% select(USUBJID, VSSTRESN, VSSTRESU, VSDTC) \%>\% rename( diff --git a/vignettes/advs.Rmd b/vignettes/advs.Rmd index d6beabc..a748e30 100644 --- a/vignettes/advs.Rmd +++ b/vignettes/advs.Rmd @@ -47,6 +47,7 @@ Once the required packages have been loaded, the first step is preparing the met ```{r message=FALSE} library(admiral) +library(pharmaversesdtm, warn.conflicts = FALSE) library(admiralpeds) library(dplyr, warn.conflicts = FALSE) library(lubridate)