Skip to content

Commit

Permalink
chore: replace scda with random.cdisc.data
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Apr 9, 2024
1 parent 882639c commit 64d9e1f
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 242 deletions.
6 changes: 4 additions & 2 deletions RNA-seq/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers
## Data reproducible code ----
data <- teal_data()
data <- within(data, {
library(scda.2022)
library(nestcolor)
ADTTE <- scda::synthetic_cdisc_dataset("rcd_2022_06_27", "adtte") %>%
library(random.cdisc.data)

ADSL <- radsl(seed = 1)
ADTTE <- radtte(ADSL, seed = 1) %>%
dplyr::mutate(is_event = CNSR == 0)
MAE <- hermes::multi_assay_experiment
})
Expand Down
44 changes: 16 additions & 28 deletions RNA-seq/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2660,37 +2660,25 @@
],
"Hash": "c19df082ba346b0ffa6f833e92de34d1"
},
"scda": {
"Package": "scda",
"Version": "0.1.6",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda",
"RemoteRef": "v0.1.6",
"RemoteSha": "665d4540a8f3c9e8d9271c33b5dd70296b49636c",
"Remotes": "insightsengineering/scda.2022@*release",
"random.cdisc.data": {
"Package": "random.cdisc.data",
"Version": "0.3.15",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "050ae235c739506fb50990d8e03518bb"
},
"scda.2022": {
"Package": "scda.2022",
"Version": "0.1.5",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda.2022",
"RemoteRef": "v0.1.5",
"RemoteSha": "5b08051312fababe15476f21323d17bcbb0543cf",
"Requirements": [
"R"
"checkmate",
"dplyr",
"lifecycle",
"lubridate",
"magrittr",
"rlang",
"stringr",
"tibble",
"tidyr",
"yaml"
],
"Hash": "0e04543b6e8a5f658699c9cdc50534c8"
"Hash": "c92edb70a24230a0b30f961c431c9fdf"
},
"shape": {
"Package": "shape",
Expand Down
19 changes: 9 additions & 10 deletions early-dev/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers
## Data reproducible code ----
data <- teal_data()
data <- within(data, {
library(scda)
library(scda.2022)
library(random.cdisc.data)
library(dplyr)
library(nestcolor)
# optional libraries
library(sparkline)

ADSL <- synthetic_cdisc_dataset("latest", "adsl")
ADSL <- radsl(seed = 1)

# derive ADSL treatment duration
adsl_labels <- teal.data::col_labels(ADSL, fill = FALSE)
Expand All @@ -34,7 +33,7 @@ data <- within(data, {
droplevels()
teal.data::col_labels(ADSL)[c(names(adsl_labels))] <- adsl_labels

ADAE <- synthetic_cdisc_dataset("latest", "adae")
ADAE <- radae(ADSL, seed = 1)

# derive common flags for AEs
adae_labels <- teal.data::col_labels(ADAE, fill = FALSE)
Expand Down Expand Up @@ -67,7 +66,7 @@ data <- within(data, {
AELLT = "Lowest Level Term"
)

ADCM <- synthetic_cdisc_dataset("latest", "adcm")
ADCM <- radcm(ADSL, seed = 1)

# process ADCM
ADCM <- ADCM %>%
Expand All @@ -80,7 +79,7 @@ data <- within(data, {
AENDT = "Analysis End Date"
)

ADEX <- synthetic_cdisc_dataset("latest", "adex")
ADEX <- radex(ADSL, seed = 1)

# process ADEX
ADEX <- ADEX %>%
Expand All @@ -93,7 +92,7 @@ data <- within(data, {
AENDT = "Analysis End Date"
)

ADTR <- synthetic_cdisc_dataset("latest", "adtr")
ADTR <- radtr(ADSL, seed = 1)

# process ADTR
adtr_labels <- teal.data::col_labels(ADTR, fill = FALSE)
Expand All @@ -113,19 +112,19 @@ data <- within(data, {


# process ADRS
ADRSSWIM <- synthetic_cdisc_dataset("latest", "adrs") %>%
ADRSSWIM <- radrs(ADSL, seed = 1) %>%
filter(PARAMCD == "OVRINV") %>%
arrange(USUBJID)

ADRS <- synthetic_cdisc_dataset("latest", "adrs")
ADRS <- radrs(ADSL, seed = 1)
adrs_labels <- teal.data::col_labels(ADRS, fill = FALSE)
ADRS <- ADRS %>%
filter(PARAMCD %in% c("BESRSPI", "INVET")) %>%
mutate(ADT = as.Date(ADTM)) %>%
droplevels()
teal.data::col_labels(ADRS)["ADT"] <- "Analysis Date"

ADLB <- synthetic_cdisc_dataset("latest", "adlb")
ADLB <- radlb(ADSL, seed = 1)

# process ADLB
ADLB <- ADLB %>%
Expand Down
44 changes: 16 additions & 28 deletions early-dev/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2312,37 +2312,25 @@
],
"Hash": "c19df082ba346b0ffa6f833e92de34d1"
},
"scda": {
"Package": "scda",
"Version": "0.1.6",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda",
"RemoteRef": "v0.1.6",
"RemoteSha": "665d4540a8f3c9e8d9271c33b5dd70296b49636c",
"Remotes": "insightsengineering/scda.2022@*release",
"random.cdisc.data": {
"Package": "random.cdisc.data",
"Version": "0.3.15",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "050ae235c739506fb50990d8e03518bb"
},
"scda.2022": {
"Package": "scda.2022",
"Version": "0.1.5",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda.2022",
"RemoteRef": "v0.1.5",
"RemoteSha": "5b08051312fababe15476f21323d17bcbb0543cf",
"Requirements": [
"R"
"checkmate",
"dplyr",
"lifecycle",
"lubridate",
"magrittr",
"rlang",
"stringr",
"tibble",
"tidyr",
"yaml"
],
"Hash": "0e04543b6e8a5f658699c9cdc50534c8"
"Hash": "c92edb70a24230a0b30f961c431c9fdf"
},
"shape": {
"Package": "shape",
Expand Down
11 changes: 5 additions & 6 deletions efficacy/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers
data <- teal_data()
data <- within(data, {
library(dplyr)
library(scda)
library(scda.2022)
library(random.cdisc.data)
library(nestcolor)
# optional libraries
library(sparkline)

ADSL <- synthetic_cdisc_dataset("latest", "adsl")
ADSL <- radsl(seed = 1)
adsl_labels <- teal.data::col_labels(ADSL, fill = FALSE)

char_vars_asl <- names(Filter(isTRUE, sapply(ADSL, is.character)))
Expand All @@ -34,14 +33,14 @@ data <- within(data, {

teal.data::col_labels(ADSL) <- adsl_labels

ADTTE <- synthetic_cdisc_dataset("latest", "adtte")
ADTTE <- radtte(ADSL, seed = 1)

ADRS <- synthetic_cdisc_dataset("latest", "adrs")
ADRS <- radrs(ADSL, seed = 1)
adrs_labels <- teal.data::col_labels(ADRS, fill = FALSE)
ADRS <- filter(ADRS, PARAMCD == "BESRSPI" | AVISIT == "FOLLOW UP")
teal.data::col_labels(ADRS) <- adrs_labels

ADQS <- synthetic_cdisc_dataset("latest", "adqs")
ADQS <- radqs(ADSL, seed = 1)
adqs_labels <- teal.data::col_labels(ADQS, fill = FALSE)
ADQS <- ADQS %>%
filter(ABLFL != "Y" & ABLFL2 != "Y") %>%
Expand Down
44 changes: 16 additions & 28 deletions efficacy/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2108,37 +2108,25 @@
],
"Hash": "c19df082ba346b0ffa6f833e92de34d1"
},
"scda": {
"Package": "scda",
"Version": "0.1.6",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda",
"RemoteRef": "v0.1.6",
"RemoteSha": "665d4540a8f3c9e8d9271c33b5dd70296b49636c",
"Remotes": "insightsengineering/scda.2022@*release",
"random.cdisc.data": {
"Package": "random.cdisc.data",
"Version": "0.3.15",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "050ae235c739506fb50990d8e03518bb"
},
"scda.2022": {
"Package": "scda.2022",
"Version": "0.1.5",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda.2022",
"RemoteRef": "v0.1.5",
"RemoteSha": "5b08051312fababe15476f21323d17bcbb0543cf",
"Requirements": [
"R"
"checkmate",
"dplyr",
"lifecycle",
"lubridate",
"magrittr",
"rlang",
"stringr",
"tibble",
"tidyr",
"yaml"
],
"Hash": "0e04543b6e8a5f658699c9cdc50534c8"
"Hash": "c92edb70a24230a0b30f961c431c9fdf"
},
"shape": {
"Package": "shape",
Expand Down
9 changes: 4 additions & 5 deletions exploratory/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers
## Data reproducible code ----
data <- teal_data()
data <- within(data, {
library(scda)
library(scda.2022)
library(random.cdisc.data)
library(dplyr)
library(tidyr)
library(ggExtra)
Expand All @@ -30,9 +29,9 @@ data <- within(data, {
library(sparkline)


ADSL <- synthetic_cdisc_dataset("latest", "adsl")
ADRS <- synthetic_cdisc_dataset("latest", "adrs")
ADLB <- synthetic_cdisc_dataset("latest", "adlb")
ADSL <- radsl(seed = 1)
ADRS <- radrs(ADSL, seed = 1)
ADLB <- radlb(ADSL, seed = 1)
ADLBPCA <- ADLB %>%
dplyr::select(USUBJID, STUDYID, SEX, ARMCD, AVAL, AVISIT, PARAMCD) %>%
tidyr::pivot_wider(
Expand Down
44 changes: 16 additions & 28 deletions exploratory/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1912,37 +1912,25 @@
],
"Hash": "c19df082ba346b0ffa6f833e92de34d1"
},
"scda": {
"Package": "scda",
"Version": "0.1.6",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda",
"RemoteRef": "v0.1.6",
"RemoteSha": "665d4540a8f3c9e8d9271c33b5dd70296b49636c",
"Remotes": "insightsengineering/scda.2022@*release",
"random.cdisc.data": {
"Package": "random.cdisc.data",
"Version": "0.3.15",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "050ae235c739506fb50990d8e03518bb"
},
"scda.2022": {
"Package": "scda.2022",
"Version": "0.1.5",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "insightsengineering",
"RemoteRepo": "scda.2022",
"RemoteRef": "v0.1.5",
"RemoteSha": "5b08051312fababe15476f21323d17bcbb0543cf",
"Requirements": [
"R"
"checkmate",
"dplyr",
"lifecycle",
"lubridate",
"magrittr",
"rlang",
"stringr",
"tibble",
"tidyr",
"yaml"
],
"Hash": "0e04543b6e8a5f658699c9cdc50534c8"
"Hash": "c92edb70a24230a0b30f961c431c9fdf"
},
"shiny": {
"Package": "shiny",
Expand Down
7 changes: 3 additions & 4 deletions longitudinal/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ data <- within(data, {
library(DescTools)
library(magrittr)
library(dplyr)
library(scda)
library(scda.2022)
library(random.cdisc.data)
library(stringr)
# optional libraries
library(sparkline)
Expand All @@ -23,8 +22,8 @@ data <- within(data, {
# depending on if the data are SUBJECT LEVEL ANALYSIS DATASET or BASIC DATA STRUCTURE
# if for example outcome variables are added to ADSL then do also add them as columns to ADLB
# this is needed to be able to use plot splitting by outcome functionality
ADSL <- synthetic_cdisc_dataset("latest", "adsl")
ADLB <- synthetic_cdisc_dataset("latest", "adlb")
ADSL <- radsl(seed = 1)
ADLB <- radlb(ADSL, seed = 1)

################################################################################
# BEGIN: Analyst Input Required To Modify Values Below To Reflect Study Specifics
Expand Down
Loading

0 comments on commit 64d9e1f

Please sign in to comment.