Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

222 decouple scda #198

Merged
merged 13 commits into from
Jul 12, 2023
9 changes: 9 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ SECURITY.md
^LICENSE\.md$
coverage.*
^\.pre-commit-config\.yaml
_pkgdown.yml
staged_dependencies.yaml
data-raw/data.R
.gitlab-ci.yml
.lintr
.pre-commit-config.yaml
.github
^.*\.Rproj$
^\.Rproj\.user$
1 change: 1 addition & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=10
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
Expand Down
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
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# goshawk 0.1.14.9010

# Examples now use `scda.2022` data instead of `scda.2021`.

### Miscellaneous

* Deprecated `g_scatterplot`. Use `g_correlationplot` instead.
* Removed `scda` package dependency from examples.

# goshawk 0.1.14

### Fixes

* Fixed `h_caption_loqs_label` to handle multiple parameters when data frame is returned from `h_identify_loq_values`.

Check notice on line 12 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L12

"multiple" is wordy or unneeded

### Enhancements

Expand Down Expand Up @@ -51,7 +50,7 @@

### Miscellaneous

* Added R version requirement `R >= 3.6`.

Check notice on line 53 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L53

"requirement" is wordy or unneeded
* Removed dependency on the `test.nest` package.
* Removed dependency on the `utils.nest` package and replaced its functions with equivalents from the `checkmate` package.

Expand Down Expand Up @@ -96,14 +95,14 @@
- Rug plot option added.
* `g_lineplot`:
- Argument changes: `font_size` --> `plot_font_size`
- Line and symbol type can now be configured. especially useful if line splitting is used.

Check notice on line 98 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L98

"especially" can weaken meaning
- Added minimum records threshold.

Check notice on line 99 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L99

"minimum" is wordy or unneeded
- Table font size can now be controlled.
- Decreased width of error bars.
- Horizontal and columned legend orientation.

### General
* Added additional validation and description for the `loq_legend` argument.

Check notice on line 105 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L105

"additional" is wordy or unneeded
* Set legend label as variable label attribute of `trt_group` across all modules.

# goshawk 0.1.5
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 rADLB
#'
#' @keywords datasets internal
#'
#' @source internal
#' @name rADLB
"rADLB"

#' Random patient listing
#'
#' @description Random patient listing
#' @docType data
#'
#' @keywords datasets internal
#'
#' @usage rADSL
#'
#' @source internal
#' @name rADSL
"rADSL"
Comment on lines +1 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, just 2 datasets 👍

6 changes: 2 additions & 4 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 Expand Up @@ -263,7 +261,7 @@ g_boxplot <- function(data,

# Add facetting.
if (!is.null(facet_var)) {
if (facet_var != "None" & facet_var %in% names(data)) {
if (facet_var != "None" & facet_var %in% names(data)) { # nolint
if (!is_finite(facet_ncol)) facet_ncol <- 0
if (facet_ncol >= 1) {
plot1 <- plot1 +
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 # nolint
usethis::use_data(rADLB)

rADSL <- synthetic_cdisc_data("latest")$adsl # nolint
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