Skip to content

Commit

Permalink
Chore: #2040 Update admiral.test to pharmaversesdtm
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyad committed Aug 9, 2023
1 parent c7b5114 commit 4c5d9cb
Show file tree
Hide file tree
Showing 24 changed files with 102 additions and 115 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Imports:
tidyr (>= 1.0.2),
tidyselect (>= 1.1.0)
Suggests:
admiral.test (>= 0.6.0),
pharmaversesdtm,
DT,
diffdf,
knitr,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

- The function `derive_vars_dy()` is updated to avoid potential error when the input `dataset` with columns ending with `temp`. (#2012)

- Templates, vignettes, and other uses of `{admiral.test}` SDTM data are updated to use `{pharmaversesdtm}` instead. (#2040)


## Breaking Changes
- The following functions, which were deprecated in previous `{admiral}` versions, have been removed: (#1950)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}

remotes::install_github("pharmaverse/admiral.test") # This is a required dependency of {admiral}
remotes::install_github("pharmaverse/pharmaversesdtm") # This is a required dependency of {admiral}
remotes::install_github("pharmaverse/admiraldev") # This is a required dependency of {admiral}
remotes::install_github("pharmaverse/admiral")
```
Expand All @@ -37,19 +37,19 @@ remotes::install_github("pharmaverse/admiral")
The {admiral} family has several downstream and upstream dependencies and so this release shall be done in three
Phases:

* Phase 1 release is for [{admiraldev}](https://pharmaverse.github.io/admiraldev/main/), {admiral.test}, and [{admiral}](https://pharmaverse.github.io/admiral/cran-release/) core
* Phase 1 release is for [{admiraldev}](https://pharmaverse.github.io/admiraldev/main/), {pharmaversesdtm}, and [{admiral}](https://pharmaverse.github.io/admiral/cran-release/) core
* Phase 2 release is extension packages, e.g. [{admiralonco}](https://pharmaverse.github.io/admiralonco/main/), [{admiralophtha}](https://pharmaverse.github.io/admiralophtha/main/), [{admiralvaccine}](https://pharmaverse.github.io/admiralvaccine/main/)


|Release Schedule | Phase 1- Date and Packages | Phase 2- Date and Packages |
|---------------- | -------------------------- | -------------------------- |
| Q3-2023 | September 4th | September 11th |
| | [{admiraldev}](https://pharmaverse.github.io/admiraldev/main/) | [{admiralonco}](https://pharmaverse.github.io/admiralonco/main/) |
| | {admiral.test} | [{admiralophtha}](https://pharmaverse.github.io/admiralophtha/main/) |
| | {pharmaversesdtm} | [{admiralophtha}](https://pharmaverse.github.io/admiralophtha/main/) |
| | [{admiral}](https://pharmaverse.github.io/admiral/main/) | [{admiralvaccine}](https://pharmaverse.github.io/admiralvaccine/main/) |
| Q4-2023 | December 4th | December 11th |
| | [{admiraldev}](https://pharmaverse.github.io/admiraldev/main/) | [{admiralonco}](https://pharmaverse.github.io/admiralonco/main/) |
| | {admiral.test} | [{admiralophtha}](https://pharmaverse.github.io/admiralophtha/main/) |
| | {pharmaversesdtm} | [{admiralophtha}](https://pharmaverse.github.io/admiralophtha/main/) |
| | [{admiral}](https://pharmaverse.github.io/admiral/main/) | [{admiralvaccine}](https://pharmaverse.github.io/admiralvaccine/main/) |

## Main Goal
Expand Down
5 changes: 2 additions & 3 deletions inst/example_scripts/derive_single_dose.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

library(admiral.test)
library(pharmaversesdtm)
library(admiral)
library(dplyr)
data(admiral_ex)
ex <- admiral_ex
data(ex)

# check that there is only one start/end date of exposure per subject and visit
check_cond <- ex %>%
Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_adae.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: ae, adsl, ex_single
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)

Expand All @@ -14,12 +14,11 @@ library(lubridate)
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data

data("admiral_ae")
data("ae")
data("admiral_adsl")
data("ex_single")

adsl <- admiral_adsl
ae <- admiral_ae
suppae <- admiral_suppae

# When SAS datasets are imported into R using haven::read_sas(), missing
Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_adcm.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: cm, adsl
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)

Expand All @@ -14,11 +14,10 @@ library(lubridate)
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data

data("admiral_cm")
data("cm")
data("admiral_adsl")

adsl <- admiral_adsl
cm <- admiral_cm

# When SAS datasets are imported into R using haven::read_sas(), missing
# character values from SAS appear as "" characters in R, instead of appearing
Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_adeg.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Input: adsl, eg
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -18,10 +18,9 @@ library(stringr)
# For illustration purposes read in admiral test data

data("admiral_adsl")
data("admiral_eg")
data("eg")

adsl <- admiral_adsl
eg <- admiral_eg

# When SAS datasets are imported into R using haven::read_sas(), missing
# character values from SAS appear as "" characters in R, instead of appearing
Expand Down
3 changes: 1 addition & 2 deletions inst/templates/ad_adex.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -19,7 +19,6 @@ data("admiral_adsl")
data("admiral_ex")

adsl <- admiral_adsl
ex <- admiral_ex

# When SAS datasets are imported into R using haven::read_sas(), missing
# character values from SAS appear as "" characters in R, instead of appearing
Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_adlb.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: adsl, lb
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -15,10 +15,9 @@ library(stringr)
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data

data("admiral_lb")
data("lb")
data("admiral_adsl")

lb <- admiral_lb
adsl <- admiral_adsl

# When SAS datasets are imported into R using haven::read_sas(), missing
Expand Down
1 change: 0 additions & 1 deletion inst/templates/ad_adlbhy.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# Input: adlb
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)

Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_admh.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: mh, adsl
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)

Expand All @@ -13,12 +13,11 @@ library(lubridate)
# Use e.g. haven::read_sas to read in .sas7bdat, or other suitable functions
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data
data("admiral_mh")
data("mh")
data("admiral_adsl")
data("queries_mh")

adsl <- admiral_adsl
mh <- admiral_mh

mh <- convert_blanks_to_na(mh)

Expand Down
14 changes: 7 additions & 7 deletions inst/templates/ad_adpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library(dplyr)
library(lubridate)
library(stringr)

library(admiral.test) # Contains example datasets from the CDISC pilot project or simulated
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project or simulated

# ---- Load source datasets ----

Expand All @@ -21,9 +21,9 @@ library(admiral.test) # Contains example datasets from the CDISC pilot project o


# Load PC, EX, VS and ADSL
data("admiral_pc")
data("admiral_ex")
data("admiral_vs")
data("pc")
data("ex")
data("vs")

data("admiral_adsl")

Expand All @@ -36,15 +36,15 @@ adsl <- admiral_adsl

# Load EX

ex <- convert_blanks_to_na(admiral_ex)
ex <- convert_blanks_to_na(ex)

# Load PC

pc <- convert_blanks_to_na(admiral_pc)
pc <- convert_blanks_to_na(pc)

# Load VS for baseline height and weight

vs <- convert_blanks_to_na(admiral_vs)
vs <- convert_blanks_to_na(vs)

# ---- Lookup tables ----
param_lookup <- tibble::tribble(
Expand Down
18 changes: 6 additions & 12 deletions inst/templates/ad_adsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: dm, ex, ds
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -15,17 +15,11 @@ library(stringr)
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data

data("admiral_dm")
data("admiral_ds")
data("admiral_ex")
data("admiral_ae")
data("admiral_lb")

dm <- admiral_dm
ds <- admiral_ds
ex <- admiral_ex
ae <- admiral_ae
lb <- admiral_lb
data("dm")
data("ds")
data("ex")
data("ae")
data("lb")

# When SAS datasets are imported into R using haven::read_sas(), missing
# character values from SAS appear as "" characters in R, instead of appearing
Expand Down
5 changes: 2 additions & 3 deletions inst/templates/ad_advs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: adsl, vs
library(admiral)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -15,11 +15,10 @@ library(stringr)
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data

data("admiral_vs")
data("vs")
data("admiral_adsl")

adsl <- admiral_adsl
vs <- admiral_vs

# When SAS datasets are imported into R using haven::read_sas(), missing
# character values from SAS appear as "" characters in R, instead of appearing
Expand Down
16 changes: 8 additions & 8 deletions vignettes/admiral.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ for example the following script which creates a (very simple) ADSL dataset.

## Load Packages and Example Datasets

First, we will load our packages and example datasets to help with our `ADSL` creation. The `{dplyr}` and `{lubridate}` packages are `{tidyverse}` packages and used heavily throughout this script. The `{admiral}` package also leverages the `{admiral.test}` package for example SDTM datasets which are from the CDISC Pilot Study.
First, we will load our packages and example datasets to help with our `ADSL` creation. The `{dplyr}` and `{lubridate}` packages are `{tidyverse}` packages and used heavily throughout this script. The `{admiral}` package also leverages the `{pharmaversesdtm}` package for example SDTM datasets which are from the CDISC Pilot Study.

```{r, message=FALSE, warning=FALSE}
library(dplyr, warn.conflicts = FALSE)
library(lubridate)
library(admiral)
library(admiral.test)
library(pharmaversesdtm)
# Read in SDTM datasets
data("admiral_dm")
data("admiral_ds")
data("admiral_ex")
data("dm")
data("ds")
data("ex")
dm <- convert_blanks_to_na(admiral_dm)
ds <- convert_blanks_to_na(admiral_ds)
ex <- convert_blanks_to_na(admiral_ex)
dm <- convert_blanks_to_na(dm)
ds <- convert_blanks_to_na(ds)
ex <- convert_blanks_to_na(ex)
```

## Derive Treatment Variables (`TRT0xP`, `TRT0xA`) {#treatmentvargs}
Expand Down
26 changes: 13 additions & 13 deletions vignettes/adsl.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,26 @@ the environment. This will be a company specific process. Some of the
data frames needed may be `DM`, `EX`, `DS`, `AE`, and `LB`.

For example purpose, the CDISC Pilot SDTM datasets---which are included in
`{admiral.test}`---are used.
`{pharmaversesdtm}`---are used.

```{r, message=FALSE, warning=FALSE}
library(admiral)
library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
library(pharmaversesdtm)
library(lubridate)
library(stringr)
data("admiral_dm")
data("admiral_ds")
data("admiral_ex")
data("admiral_ae")
data("admiral_lb")
dm <- convert_blanks_to_na(admiral_dm)
ds <- convert_blanks_to_na(admiral_ds)
ex <- convert_blanks_to_na(admiral_ex)
ae <- convert_blanks_to_na(admiral_ae)
lb <- convert_blanks_to_na(admiral_lb)
data("dm")
data("ds")
data("ex")
data("ae")
data("lb")
dm <- convert_blanks_to_na(dm)
ds <- convert_blanks_to_na(ds)
ex <- convert_blanks_to_na(ex)
ae <- convert_blanks_to_na(ae)
lb <- convert_blanks_to_na(lb)
```

The `DM` domain is used as the basis for `ADSL`:
Expand Down
8 changes: 4 additions & 4 deletions vignettes/bds_exposure.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ To start, all data frames needed for the creation of `ADEX` should be read into
the environment. This will be a company specific process. Some of the
data frames needed may be `EX` and `ADSL`.

For example purpose, the CDISC Pilot SDTM and ADaM datasets---which are included in `{admiral.test}`---are used.
For example purpose, the CDISC Pilot SDTM and ADaM datasets---which are included in `{pharmaversesdtm}`---are used.

```{r message=FALSE}
library(admiral)
library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
library(pharmaversesdtm)
library(lubridate)
library(stringr)
library(tibble)
data("admiral_adsl")
data("admiral_ex")
data("ex")
adsl <- admiral_adsl
ex <- convert_blanks_to_na(admiral_ex)
ex <- convert_blanks_to_na(ex)
```
```{r echo=FALSE}
ex <- filter(ex, USUBJID %in% c("01-701-1015", "01-701-1023", "01-703-1086", "01-703-1096", "01-707-1037", "01-716-1024"))
Expand Down
Loading

0 comments on commit 4c5d9cb

Please sign in to comment.