Skip to content

Commit

Permalink
decouple scda
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Jul 11, 2023
1 parent 531047c commit 8ad9599
Show file tree
Hide file tree
Showing 26 changed files with 96 additions and 101 deletions.
47 changes: 5 additions & 42 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,7 @@
^renv$
^renv\.lock$
CODE_OF_CONDUCT.md
SECURITY.md
^_dev$
data-raw/data.R
.gitlab-ci.yml
.lintr
.pre-commit-config.yaml
.github
^.*\.Rproj$
^[^/]+\.html$
^[^/]+\.png$
^[^/]+\.R$
^[^/]+\.Rmd$
^\_pkgdown\.yaml$
^\_pkgdown\.yml
^\.CI-FORCE-RELEASE-VERSION$
^\.drone\.yml$
^\.github$
^\.lintr$
^\.Rprofile$
^\.Rproj\.user$
^\.travis\.yml$
^build_docker_image$
^cache$
^data-raw$
^data/script\.R$
^design$
^dev$
^doc$
^docs$
^Jenkinsfile$
^logs$
^Makefile$
^man-roxygen$
^Meta$
^outputdir$
^scratch$
^stubs$
^temp$
^templates$
^test_full_example$
^TODO\.md$
^staged_dependencies\.yaml$
^\.gitlab-ci\.yml$
^LICENSE\.md$
coverage.*
^\.pre-commit-config\.yaml
5 changes: 0 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ Suggests:
knitr,
nestcolor (>= 0.1.0),
rmarkdown,
scda (>= 0.1.5),
scda.2022 (>= 0.1.3),
testthat (>= 2.0),
tidyr
VignetteBuilder:
knitr
Remotes:
insightsengineering/scda.2022@*release,
insightsengineering/scda@*release
Config/Needs/website: insightsengineering/nesttemplate
Encoding: UTF-8
Language: en-US
Expand Down
25 changes: 25 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#' Random lab analysis
#'
#' @description Random lab analysis
#' @docType data
#'
#' @usage goshawk::rADLB
#'
#' @keywords datasets internal
#'
#' @source internal
#' @name rADLB
"rADLB"

#' Random patient listing
#'
#' @description Random patient listing
#' @docType data
#'
#' @keywords datasets internal
#'
#' @usage goshawk::rADSL
#'
#' @source internal
#' @name rADSL
"rADSL"
4 changes: 1 addition & 3 deletions R/g_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@
#'
#' @examples
#'
#'
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(nestcolor)
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
Expand Down
3 changes: 1 addition & 2 deletions R/g_correlationplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#' @examples
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#' library(tidyr)
#'
Expand All @@ -75,7 +74,7 @@
#' # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA"
#' shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0)
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
Expand Down
3 changes: 1 addition & 2 deletions R/g_density_distribution_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#'
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#'
#' # original ARM value = dose value
Expand All @@ -47,7 +46,7 @@
#' )
#' color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C")
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
Expand Down
6 changes: 2 additions & 4 deletions R/g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#'
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#' library(dplyr)
#' library(nestcolor)
Expand All @@ -65,9 +64,8 @@
#' color_manual <- c("150mg QD" = "thistle", "Placebo" = "orange", "Combination" = "steelblue")
#' type_manual <- c("150mg QD" = "solid", "Placebo" = "dashed", "Combination" = "dotted")
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl %>%
#' filter(!(ARM == "B: Placebo" & AGE < 40))
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADSL <- goshawk::rADSL %>% filter(!(ARM == "B: Placebo" & AGE < 40))
#' ADLB <- goshawk::rADLB
#' ADLB <- right_join(ADLB, ADSL[, c("STUDYID", "USUBJID")])
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#'
Expand Down
3 changes: 1 addition & 2 deletions R/g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#' @examples
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#'
#' # original ARM value = dose value
Expand All @@ -56,7 +55,7 @@
#' # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA"
#' shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0)
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
Expand Down
3 changes: 1 addition & 2 deletions R/g_spaghettiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#'
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#'
#' # original ARM value = dose value
Expand All @@ -56,7 +55,7 @@
#' )
#' color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C")
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' var_labels <- lapply(ADLB, function(x) attributes(x)$label)
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
Expand Down
3 changes: 1 addition & 2 deletions R/t_summarytable.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
#' @examples
#' # Example using ADaM structure analysis dataset.
#'
#' library(scda)
#' library(stringr)
#'
#' # original ARM value = dose value
#' arm_mapping <- list(
#' "A: Drug X" = "150mg QD", "B: Placebo" = "Placebo", "C: Combination" = "Combination"
#' )
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' ADLB <- goshawk::rADLB
#' ADLB <- ADLB %>%
#' mutate(AVISITCD = case_when(
#' AVISIT == "SCREENING" ~ "SCR",
Expand Down
9 changes: 2 additions & 7 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
#' @keywords internal
#'
#' @examples
#' library(scda)
#'
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#'
#' goshawk:::h_identify_loq_values(loqs_data = ADLB)
#' goshawk:::h_identify_loq_values(loqs_data = goshawk::rADLB)
h_identify_loq_values <- function(loqs_data) {
ifelse(
!grep("PARAM", names(loqs_data)),
Expand Down Expand Up @@ -79,9 +76,7 @@ h_identify_loq_values <- function(loqs_data) {
#' @keywords internal
#'
#' @examples
#' library(scda)
#' ADLB <- synthetic_cdisc_data("latest")$adlb
#' caption_label <- goshawk:::h_caption_loqs_label(loqs_data = ADLB)
#' caption_label <- goshawk:::h_caption_loqs_label(loqs_data = goshawk::rADLB)
h_caption_loqs_label <- function(loqs_data) {
loq_values <- h_identify_loq_values(loqs_data)

Expand Down
6 changes: 6 additions & 0 deletions data-raw/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library(scda)
rADLB <- synthetic_cdisc_data("latest")$adlb

Check warning on line 2 in data-raw/data.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / SuperLinter 🦸‍♂️

file=/github/workspace/data-raw/data.R,line=2,col=1,[object_name_linter] Variable and function name style should be snake_case or symbols.
usethis::use_data(rADLB)

rADSL <- synthetic_cdisc_data("latest")$adsl

Check warning on line 5 in data-raw/data.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / SuperLinter 🦸‍♂️

file=/github/workspace/data-raw/data.R,line=5,col=1,[object_name_linter] Variable and function name style should be snake_case or symbols.
usethis::use_data(rADSL)
Binary file added data/rADLB.rda
Binary file not shown.
Binary file added data/rADSL.rda
Binary file not shown.
4 changes: 1 addition & 3 deletions man/g_boxplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/g_correlationplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/g_density_distribution_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions man/g_lineplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/g_scatterplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/g_spaghettiplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/h_caption_loqs_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions man/h_identify_loq_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/rADLB.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8ad9599

Please sign in to comment.