diff --git a/DESCRIPTION b/DESCRIPTION index dbcd7f45..c85719b6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -48,11 +48,12 @@ Imports: Suggests: knitr, lubridate (>= 1.7.4), - pharmaversesdtm (>= 0.2.0), + pharmaversesdtm, rmarkdown, stringr (>= 1.4.0), testthat (>= 3.0.0), tibble +Remotes: pharmaverse/pharmaversesdtm@admiralpeds_data_migration VignetteBuilder: knitr Config/testthat/edition: 3 diff --git a/NEWS.md b/NEWS.md index 3b96a965..a6592c41 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ ## Documentation - Added CRAN installation instructions to README (#10). +- Subject based test data (e.g. DM, VS) has been migrated out of `{admiralpeds}` to `{pharmaversesdtm}` (#40) ## Various diff --git a/R/data.R b/R/data.R index 3e8083b7..ac7886ea 100644 --- a/R/data.R +++ b/R/data.R @@ -193,20 +193,6 @@ #' @source \url{https://www.cdc.gov/growthcharts/percentile_data_files.htm} "cdc_bmiage" -#' Demographic Dataset-pediatrics -#' -#' An updated SDTM DM dataset with pediatric patients -#' @keywords datasets -#' @family datasets -"dm_peds" - -#' Vital signs Dataset-pediatrics -#' -#' An updated SDTM VS dataset with anthropometric measurements for pediatric patients -#' @keywords datasets -#' @family datasets -"vs_peds" - #' Subject Level Analysis Dataset-pediatrics #' #' An updated ADaM ADSL dataset with pediatric patients diff --git a/R/derive_params_growth_age.R b/R/derive_params_growth_age.R index 9c033631..c56b9b05 100644 --- a/R/derive_params_growth_age.R +++ b/R/derive_params_growth_age.R @@ -116,10 +116,11 @@ #' library(lubridate, warn.conflicts = FALSE) #' library(rlang, warn.conflicts = FALSE) #' library(admiral, warn.conflicts = FALSE) +#' library(pharmaversesdtm, warn.conflicts = FALSE) #' -#' advs <- dm_peds %>% +#' advs <- pharmaversesdtm::dm_peds %>% #' select(USUBJID, BRTHDTC, SEX) %>% -#' right_join(., vs_peds, by = "USUBJID") %>% +#' right_join(., pharmaversesdtm::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 1c33767c..89572ba5 100644 --- a/R/derive_params_growth_height.R +++ b/R/derive_params_growth_height.R @@ -114,12 +114,13 @@ #' library(lubridate, warn.conflicts = FALSE) #' library(rlang, warn.conflicts = FALSE) #' library(admiral, warn.conflicts = FALSE) +#' 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 <- dm_peds %>% +#' advs <- pharmaversesdtm::dm_peds %>% #' select(USUBJID, BRTHDTC, SEX) %>% -#' right_join(., vs_peds, by = "USUBJID") %>% +#' right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") %>% #' mutate( #' VSDT = ymd(VSDTC), #' BRTHDT = ymd(BRTHDTC) @@ -132,7 +133,7 @@ #' out_unit = "days" #' ) #' -#' heights <- vs_peds %>% +#' heights <- pharmaversesdtm::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 f5adc1f2..75934740 100644 --- a/data-raw/adsl_peds.R +++ b/data-raw/adsl_peds.R @@ -11,8 +11,8 @@ library(stringr) # Create a basic ADSL for pediatrics ---- # Read in input data ---- -data("dm_peds") -data("ex") +dm_peds <- pharmaversesdtm::dm_peds +ex <- pharmaversesdtm::ex # Derivations ---- diff --git a/data-raw/dm_peds.R b/data-raw/dm_peds.R deleted file mode 100644 index b4edc65c..00000000 --- a/data-raw/dm_peds.R +++ /dev/null @@ -1,47 +0,0 @@ -# Dataset: dm_peds -# Description: Create DM test SDTM dataset for pediatric studies - -# Load libraries ----- -library(dplyr) -library(admiral) -library(pharmaversesdtm) - -# Read input test data from pharmaversesdtm ---- -data("dm") - -# Convert blank to NA ---- -dm <- convert_blanks_to_na(dm) - -# Subset to first 5 patients only (which is enough for our examples) ---- -dm_subset <- dm %>% - filter(USUBJID %in% c( - "01-701-1015", "01-701-1023", "01-701-1028", - "01-701-1033", "01-701-1034" - )) - -# Add birth dates/age realistic for pediatrics in line with treatment dates ---- -dm_peds <- dm_subset %>% - mutate(BRTHDTC = case_when( - USUBJID == "01-701-1015" ~ "2013-01-02", - USUBJID == "01-701-1023" ~ "2010-08-05", - USUBJID == "01-701-1028" ~ "2010-07-19", - USUBJID == "01-701-1033" ~ "2014-01-01", - USUBJID == "01-701-1034" ~ "2014-06-01" - )) %>% - mutate(AGE = case_when( - USUBJID == "01-701-1015" ~ 1, - USUBJID == "01-701-1023" ~ 2, - USUBJID == "01-701-1028" ~ 3, - USUBJID == "01-701-1033" ~ 0, - USUBJID == "01-701-1034" ~ 0 - )) - -# Variable labels ---- -attr(dm_peds$BRTHDTC, "label") <- "Date/Time of Birth" -attr(dm_peds$AGE, "label") <- "Age" - -# Label dataset ---- -attr(dm_peds, "label") <- "Demographics" - -# Save dataset ---- -usethis::use_data(dm_peds, overwrite = TRUE) diff --git a/data-raw/vs_peds.R b/data-raw/vs_peds.R deleted file mode 100644 index 538a1176..00000000 --- a/data-raw/vs_peds.R +++ /dev/null @@ -1,262 +0,0 @@ -# Dataset: vs_peds -# Description: Create VS test SDTM dataset for pediatric studies - -# Load libraries ----- -library(dplyr) -library(admiral) -library(pharmaversesdtm) - -# Read input test data from pharmaversesdtm ---- -data("vs") - -# Convert blank to NA ---- -vs <- convert_blanks_to_na(vs) - -# Subset to 5 patients present in dm_peds and only keep WEIGHT records ---- -vs_subset <- vs %>% - filter(USUBJID %in% c( - "01-701-1015", "01-701-1023", "01-701-1028", - "01-701-1033", "01-701-1034" - ) & - VSTESTCD %in% c("WEIGHT")) - -# Create placeholder records for HEIGHT, BMI and HDCIRC from the WEIGHT records -vs_subset_height <- vs_subset %>% - mutate(VSTESTCD = "HEIGHT") -vs_subset_bmi <- vs_subset %>% - mutate(VSTESTCD = "BMI") -vs_subset_hdcirc <- vs_subset %>% - mutate(VSTESTCD = "HDCIRC") - -# Bind new parameter records to original dataset -vs_subset_full <- bind_rows( - vs_subset, - vs_subset_height, - vs_subset_bmi, - vs_subset_hdcirc -) %>% - arrange(USUBJID, VSTESTCD, VISITNUM, VSDY) - -# Updating each parameters values and units to be consistent with the ages of these dummy patients -vs_peds <- vs_subset_full %>% - mutate(VSSTRESN = case_when( - USUBJID == "01-701-1015" & VSTESTCD == "WEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 9.11, - VISIT == "BASELINE" ~ 9.2, - VISIT == "WEEK 2" ~ 9.32, - VISIT == "WEEK 4" ~ 9.54, - VISIT == "WEEK 6" ~ 9.7, - VISIT == "WEEK 8" ~ 9.91, - VISIT == "WEEK 12" ~ 10.3, - VISIT == "WEEK 16" ~ 10.7, - VISIT == "WEEK 20" ~ 11.1, - VISIT == "WEEK 24" ~ 11.56, - VISIT == "WEEK 26" ~ 11.71, - ), - USUBJID == "01-701-1015" & VSTESTCD == "HEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 74.13, - VISIT == "BASELINE" ~ 74.41, - VISIT == "WEEK 2" ~ 74.71, - VISIT == "WEEK 4" ~ 75.32, - VISIT == "WEEK 6" ~ 75.93, - VISIT == "WEEK 8" ~ 76.54, - VISIT == "WEEK 12" ~ 77.72, - VISIT == "WEEK 16" ~ 78.96, - VISIT == "WEEK 20" ~ 80.22, - VISIT == "WEEK 24" ~ 81.43, - VISIT == "WEEK 26" ~ 82.03 - ), - USUBJID == "01-701-1015" & VSTESTCD == "HDCIRC" ~ case_when( - VISIT == "SCREENING 1" ~ 35.61, - VISIT == "BASELINE" ~ 37.24, - VISIT == "WEEK 2" ~ 38.57, - VISIT == "WEEK 4" ~ 39.84, - VISIT == "WEEK 6" ~ 40.95, - VISIT == "WEEK 8" ~ 42.14, - VISIT == "WEEK 12" ~ 43.67, - VISIT == "WEEK 16" ~ 44.79, - VISIT == "WEEK 20" ~ 45.92, - VISIT == "WEEK 24" ~ 46.88, - VISIT == "WEEK 26" ~ 47.56 - ), - USUBJID == "01-701-1023" & VSTESTCD == "WEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 12.47, - VISIT == "BASELINE" ~ 12.89, - VISIT == "WEEK 2" ~ 13.14, - VISIT == "WEEK 4" ~ 13.45 - ), - USUBJID == "01-701-1023" & VSTESTCD == "HEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 87.65, - VISIT == "BASELINE" ~ 88.25, - VISIT == "WEEK 2" ~ 88.75, - VISIT == "WEEK 4" ~ 89.23 - ), - USUBJID == "01-701-1023" & VSTESTCD == "HDCIRC" ~ case_when( - VISIT == "SCREENING 1" ~ 48.34, - VISIT == "BASELINE" ~ 48.71, - VISIT == "WEEK 2" ~ 49.12, - VISIT == "WEEK 4" ~ 49.56 - ), - USUBJID == "01-701-1028" & VSTESTCD == "HEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 98.32, - VISIT == "BASELINE" ~ 98.95, - VISIT == "WEEK 2" ~ 99.34, - VISIT == "WEEK 4" ~ 99.68, - VISIT == "WEEK 6" ~ 100.13, - VISIT == "WEEK 8" ~ 100.45, - VISIT == "WEEK 12" ~ 101.02, - VISIT == "WEEK 16" ~ 101.48, - VISIT == "WEEK 20" ~ 101.97, - VISIT == "WEEK 24" ~ 102.44, - VISIT == "WEEK 26" ~ 102.82 - ), - USUBJID == "01-701-1028" & VSTESTCD == "WEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 14.65, - VISIT == "BASELINE" ~ 14.95, - VISIT == "WEEK 2" ~ 15.17, - VISIT == "WEEK 4" ~ 15.43, - VISIT == "WEEK 6" ~ 15.66, - VISIT == "WEEK 8" ~ 15.84, - VISIT == "WEEK 12" ~ 16.34, - VISIT == "WEEK 16" ~ 16.73, - VISIT == "WEEK 20" ~ 17.11, - VISIT == "WEEK 24" ~ 17.56, - VISIT == "WEEK 26" ~ 17.85 - ), - USUBJID == "01-701-1028" & VSTESTCD == "HDCIRC" ~ case_when( - VISIT == "SCREENING 1" ~ 51.34, - VISIT == "BASELINE" ~ 51.71, - VISIT == "WEEK 2" ~ 52.12, - VISIT == "WEEK 4" ~ 52.56, - VISIT == "WEEK 6" ~ 52.93, - VISIT == "WEEK 8" ~ 53.45, - VISIT == "WEEK 12" ~ 54.02, - VISIT == "WEEK 16" ~ 54.48, - VISIT == "WEEK 20" ~ 54.97, - VISIT == "WEEK 24" ~ 55.44, - VISIT == "WEEK 26" ~ 55.82 - ), - USUBJID == "01-701-1033" & VSTESTCD == "HEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 59.45, - VISIT == "BASELINE" ~ 60.53, - VISIT == "WEEK 2" ~ 61.72, - VISIT == "WEEK 4" ~ 62.91 - ), - USUBJID == "01-701-1033" & VSTESTCD == "WEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 5.62, - VISIT == "BASELINE" ~ 5.89, - VISIT == "WEEK 2" ~ 6.17, - VISIT == "WEEK 4" ~ 6.45 - ), - USUBJID == "01-701-1033" & VSTESTCD == "HDCIRC" ~ case_when( - VISIT == "SCREENING 1" ~ 40.34, - VISIT == "BASELINE" ~ 40.71, - VISIT == "WEEK 2" ~ 41.12, - VISIT == "WEEK 4" ~ 41.56 - ), - USUBJID == "01-701-1034" & VSTESTCD == "HEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 53.65, - VISIT == "BASELINE" ~ 54.78, - VISIT == "WEEK 2" ~ 55.95, - VISIT == "WEEK 4" ~ 57.14, - VISIT == "WEEK 6" ~ 58.23, - VISIT == "WEEK 8" ~ 59.45, - VISIT == "WEEK 12" ~ 60.67, - VISIT == "WEEK 16" ~ 61.79, - VISIT == "WEEK 20" ~ 62.91, - VISIT == "WEEK 24" ~ 64.03, - VISIT == "WEEK 26" ~ 65.15 - ), - USUBJID == "01-701-1034" & VSTESTCD == "WEIGHT" ~ case_when( - VISIT == "SCREENING 1" ~ 4.25, - VISIT == "BASELINE" ~ 4.56, - VISIT == "WEEK 2" ~ 4.84, - VISIT == "WEEK 4" ~ 5.15, - VISIT == "WEEK 6" ~ 5.47, - VISIT == "WEEK 8" ~ 5.79, - VISIT == "WEEK 12" ~ 6.11, - VISIT == "WEEK 16" ~ 6.43, - VISIT == "WEEK 20" ~ 6.75, - VISIT == "WEEK 24" ~ 7.07, - VISIT == "WEEK 26" ~ 7.39 - ), - USUBJID == "01-701-1034" & VSTESTCD == "HDCIRC" ~ case_when( - VISIT == "SCREENING 1" ~ 38.45, - VISIT == "BASELINE" ~ 38.92, - VISIT == "WEEK 2" ~ 39.34, - VISIT == "WEEK 4" ~ 39.78, - VISIT == "WEEK 6" ~ 40.23, - VISIT == "WEEK 8" ~ 40.65, - VISIT == "WEEK 12" ~ 41.07, - VISIT == "WEEK 16" ~ 41.48, - VISIT == "WEEK 20" ~ 41.89, - VISIT == "WEEK 24" ~ 42.30, - VISIT == "WEEK 26" ~ 42.72 - ), - TRUE ~ VSSTRESN - )) - -# Derive BMI values ---- -vs_peds <- vs_peds %>% - arrange(USUBJID, VISITNUM, VSTESTCD, VSDY) %>% - group_by(USUBJID, VISITNUM) %>% - mutate( - VSSTRESN = case_when( - VSTESTCD == "BMI" ~ { - weight <- VSSTRESN[VSTESTCD == "WEIGHT"] - height <- VSSTRESN[VSTESTCD == "HEIGHT"] / 100 # Convert height from cm to m - as.numeric(weight / (height^2)) # BMI calculation - }, - TRUE ~ VSSTRESN - ) - ) %>% - ungroup() - -# Formatting the output dataset ---- -vs_peds <- vs_peds %>% - mutate( - VSSEQ = row_number(), - VSPOS = NA_character_, - VSORRESU = case_when( - VSTESTCD == "HEIGHT" ~ "cm", - VSTESTCD == "WEIGHT" ~ "kg", - VSTESTCD == "BMI" ~ "kg/m2", - VSTESTCD == "HDCIRC" ~ "cm", - TRUE ~ NA_character_ - ), - VSTEST = case_when( - VSTESTCD == "HEIGHT" ~ "Height", - VSTESTCD == "WEIGHT" ~ "Weight", - VSTESTCD == "BMI" ~ "BMI", - VSTESTCD == "HDCIRC" ~ "Head Circumference", - TRUE ~ NA_character_ - ), - VSSTRESC = as.character(VSSTRESN), - VSORRES = VSSTRESC, - VSSTRESU = VSORRESU, - VSSTAT = NA_character_, - VSLOC = NA_character_, - VSBLFL = if_else(VISITNUM == 2, "Y", NA_character_), - VISITDY = NA_integer_, - VSDY = NA_integer_, - VSEVAL = NA_character_, - EPOCH = "Epoch" - ) %>% - arrange(USUBJID, VSTESTCD, VISITNUM, VSDY) - -# Get common column names with VS -common_cols <- intersect(names(vs), names(vs_peds)) - -# Copy attributes (including labels) from vs to vs_peds for common columns -for (col in common_cols) { - attributes(vs_peds[[col]]) <- attributes(vs[[col]]) -} -# Set the labels for non-commn variables -attr(vs_peds$VSEVAL, "label") <- "Evaluator" -attr(vs_peds$EPOCH, "label") <- "Epoch" - -# Label dataset ---- -attr(vs_peds, "label") <- "Vital Signs" - -# Save dataset ---- -usethis::use_data(vs_peds, overwrite = TRUE) diff --git a/data/dm_peds.rda b/data/dm_peds.rda deleted file mode 100644 index 362c2ec0..00000000 Binary files a/data/dm_peds.rda and /dev/null differ diff --git a/data/vs_peds.rda b/data/vs_peds.rda deleted file mode 100644 index db1d926a..00000000 Binary files a/data/vs_peds.rda and /dev/null differ diff --git a/inst/templates/ad_advs.R b/inst/templates/ad_advs.R index 154b6be7..1193fa12 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(pharmaversesdtm) library(admiralpeds) library(dplyr) library(lubridate) @@ -29,9 +30,9 @@ The user could replace these metadata with their own chosen metadata") # For weight-based indicators we keep WHO and CDC separate due to the WHO # adjustment (restricted application of the LMS method) needed for the # anthropometric indicator derivations -data(WHO_bmi_for_age_boys) -data(WHO_bmi_for_age_girls) -data(cdc_bmiage) +who_bmi_for_age_boys <- admiralpeds::who_bmi_for_age_boys +who_bmi_for_age_girls <- admiralpeds::who_bmi_for_age_girls +cdc_bmiage <- admiralpeds::cdc_bmiage who_bmi_for_age <- who_bmi_for_age_boys %>% mutate(SEX = "M") %>% @@ -70,9 +71,9 @@ cdc_bmi_for_age <- cdc_bmiage %>% # Default reference sources: WHO for children <2 yrs old (< 730.5 days), # and CDC for children >=2 yrs old (>= 730.5 days) # Combine WHO and CDC metadata -data(who_lgth_ht_for_age_boys) -data(who_lgth_ht_for_age_girls) -data(cdc_htage) +who_lgth_ht_for_age_boys <- admiralpeds::who_lgth_ht_for_age_boys +who_lgth_ht_for_age_girls <- admiralpeds::who_lgth_ht_for_age_girls +cdc_htage <- admiralpeds::cdc_htage height_for_age <- who_lgth_ht_for_age_boys %>% mutate(SEX = "M") %>% @@ -111,9 +112,9 @@ height_for_age <- who_lgth_ht_for_age_boys %>% # For weight-based indicators we keep WHO and CDC separate due to the WHO # adjustment (restricted application of the LMS method) needed for the # anthropometric indicator derivations -data(who_wt_for_age_boys) -data(who_wt_for_age_girls) -data(cdc_wtage) +who_wt_for_age_boys <- admiralpeds::who_wt_for_age_boys +who_wt_for_age_girls <- admiralpeds::who_wt_for_age_girls +cdc_wtage <- admiralpeds::cdc_wtage who_wt_for_age <- who_wt_for_age_boys %>% mutate(SEX = "M") %>% @@ -150,8 +151,8 @@ cdc_wt_for_age <- cdc_wtage %>% ## WHO - HEAD CIRCUMFERENCE for age ---- # Default reference sources: WHO for children up to 5 yrs old -data(who_hc_for_age_boys) -data(who_hc_for_age_girls) +who_hc_for_age_boys <- admiralpeds::who_hc_for_age_boys +who_hc_for_age_girls <- admiralpeds::who_hc_for_age_girls who_hc_for_age <- who_hc_for_age_boys %>% mutate(SEX = "M") %>% @@ -164,8 +165,8 @@ who_hc_for_age <- who_hc_for_age_boys %>% ## WHO - WEIGHT for LENGTH ---- # Default reference sources: WHO for children <2 yrs old (< 730.5 days) -data(who_wt_for_lgth_boys) -data(who_wt_for_lgth_girls) +who_wt_for_lgth_boys <- admiralpeds::who_wt_for_lgth_boys +who_wt_for_lgth_girls <- admiralpeds::who_wt_for_lgth_girls who_wt_for_lgth <- who_wt_for_lgth_boys %>% mutate(SEX = "M") %>% @@ -180,8 +181,8 @@ 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 -data("vs_peds") -data("adsl_peds") +vs_peds <- pharmaversesdtm::vs_peds +adsl_peds <- admiralpeds::adsl_peds vs <- vs_peds adsl <- adsl_peds %>% select(-DOMAIN) diff --git a/man/adsl_peds.Rd b/man/adsl_peds.Rd index fdc44002..919f8926 100644 --- a/man/adsl_peds.Rd +++ b/man/adsl_peds.Rd @@ -13,10 +13,5 @@ adsl_peds \description{ An updated ADaM ADSL dataset with pediatric patients } -\seealso{ -Datasets -\code{\link{dm_peds}}, -\code{\link{vs_peds}} -} \concept{datasets} \keyword{datasets} diff --git a/man/derive_params_growth_age.Rd b/man/derive_params_growth_age.Rd index 9f1a05ba..b6a21e6e 100644 --- a/man/derive_params_growth_age.Rd +++ b/man/derive_params_growth_age.Rd @@ -130,10 +130,11 @@ library(dplyr, warn.conflicts = FALSE) library(lubridate, warn.conflicts = FALSE) library(rlang, warn.conflicts = FALSE) library(admiral, warn.conflicts = FALSE) +library(pharmaversesdtm, warn.conflicts = FALSE) -advs <- dm_peds \%>\% +advs <- pharmaversesdtm::dm_peds \%>\% select(USUBJID, BRTHDTC, SEX) \%>\% - right_join(., vs_peds, by = "USUBJID") \%>\% + right_join(., pharmaversesdtm::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 f7c0026f..51f3513e 100644 --- a/man/derive_params_growth_height.Rd +++ b/man/derive_params_growth_height.Rd @@ -127,12 +127,13 @@ library(dplyr, warn.conflicts = FALSE) library(lubridate, warn.conflicts = FALSE) library(rlang, warn.conflicts = FALSE) library(admiral, warn.conflicts = FALSE) +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 <- dm_peds \%>\% +advs <- pharmaversesdtm::dm_peds \%>\% select(USUBJID, BRTHDTC, SEX) \%>\% - right_join(., vs_peds, by = "USUBJID") \%>\% + right_join(., pharmaversesdtm::vs_peds, by = "USUBJID") \%>\% mutate( VSDT = ymd(VSDTC), BRTHDT = ymd(BRTHDTC) @@ -145,7 +146,7 @@ advs <- dm_peds \%>\% out_unit = "days" ) -heights <- vs_peds \%>\% +heights <- pharmaversesdtm::vs_peds \%>\% filter(VSTESTCD == "HEIGHT") \%>\% select(USUBJID, VSSTRESN, VSSTRESU, VSDTC) \%>\% rename( diff --git a/man/dm_peds.Rd b/man/dm_peds.Rd deleted file mode 100644 index da99dfb8..00000000 --- a/man/dm_peds.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{dm_peds} -\alias{dm_peds} -\title{Demographic Dataset-pediatrics} -\format{ -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 5 rows and 26 columns. -} -\usage{ -dm_peds -} -\description{ -An updated SDTM DM dataset with pediatric patients -} -\seealso{ -Datasets -\code{\link{adsl_peds}}, -\code{\link{vs_peds}} -} -\concept{datasets} -\keyword{datasets} diff --git a/man/vs_peds.Rd b/man/vs_peds.Rd deleted file mode 100644 index 681ade11..00000000 --- a/man/vs_peds.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{vs_peds} -\alias{vs_peds} -\title{Vital signs Dataset-pediatrics} -\format{ -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 164 rows and 26 columns. -} -\usage{ -vs_peds -} -\description{ -An updated SDTM VS dataset with anthropometric measurements for pediatric patients -} -\seealso{ -Datasets -\code{\link{adsl_peds}}, -\code{\link{dm_peds}} -} -\concept{datasets} -\keyword{datasets} diff --git a/staged_dependencies.yaml b/staged_dependencies.yaml index 734bdadb..304b872c 100644 --- a/staged_dependencies.yaml +++ b/staged_dependencies.yaml @@ -4,6 +4,8 @@ upstream_repos: host: https://github.com - repo: pharmaverse/admiraldev host: https://github.com + - repo: pharmaverse/pharmaversesdtm + host: https://github.com downstream_repos: diff --git a/vignettes/advs.Rmd b/vignettes/advs.Rmd index 0df866cb..e35254c9 100644 --- a/vignettes/advs.Rmd +++ b/vignettes/advs.Rmd @@ -15,6 +15,7 @@ knitr::opts_chunk$set( ) library(admiral) library(admiraldev) +library(rlang) ``` # Introduction @@ -46,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) @@ -106,9 +108,9 @@ We do this pre-processing of the metadata using the following code for BMI as an example: ```{r eval=TRUE} -data(WHO_bmi_for_age_boys) -data(WHO_bmi_for_age_girls) -data(cdc_bmiage) +who_bmi_for_age_boys <- admiralpeds::who_bmi_for_age_boys +who_bmi_for_age_girls <- admiralpeds::who_bmi_for_age_girls +cdc_bmiage <- admiralpeds::cdc_bmiage who_bmi_for_age <- who_bmi_for_age_boys %>% mutate(SEX = "M") %>% @@ -193,8 +195,8 @@ files if preferred. We do this using the following code: ```{r eval=TRUE} -data(who_wt_for_lgth_boys) -data(who_wt_for_lgth_girls) +who_wt_for_lgth_boys <- admiralpeds::who_wt_for_lgth_boys +who_wt_for_lgth_girls <- admiralpeds::who_wt_for_lgth_girls who_wt_for_lgth <- who_wt_for_lgth_boys %>% mutate(SEX = "M") %>% @@ -230,8 +232,8 @@ include the pediatrics-specific parameters as needed - for example: | BMIPCTL | BMI-for-age percentile | 10 | Subject Characteristic | 1 | ```{r echo=FALSE, message=FALSE} -data("vs_peds") -data("adsl_peds") +vs_peds <- pharmaversesdtm::vs_peds +adsl_peds <- admiralpeds::adsl_peds vs <- convert_blanks_to_na(vs_peds) adsl <- adsl_peds %>% select(-DOMAIN)