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

intended use #105

Merged
merged 45 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c66b671
refactor arguments organisation
Nov 2, 2021
7c28f55
linter correction
Nov 2, 2021
fc1aa00
Document
Nov 2, 2021
32f35dc
add_existing_table
Nov 3, 2021
a362a50
Merge branch '79_split-gen_args_spec_study@main' into 84_maintain-tit…
Nov 3, 2021
7e49f6c
linting
Nov 3, 2021
5dc770f
add a setfooter function as a temporary fix
Nov 4, 2021
dfb217e
linting
Nov 4, 2021
e65d5d2
add return description
Nov 4, 2021
92c9087
work in progress
Nov 16, 2021
3fd0e7b
work on aet02.R
Nov 18, 2021
77e459e
Merge branch '84_maintain-title-subtitle-and-footnotes@main' into 94_…
Nov 19, 2021
63241fe
bugfix
Nov 24, 2021
77256aa
discussion with Adrian
Nov 24, 2021
fc88bcb
add filter for adex
Nov 24, 2021
265d94a
changes as discussed in the meeting
Nov 24, 2021
0ea94ef
simplify layout function
Nov 25, 2021
12f33ba
as per discussion
Nov 25, 2021
4381b71
rename args
Nov 25, 2021
5301645
start working on vignettes
Nov 24, 2021
d7ae31d
added more content
Nov 24, 2021
1461784
work on adam_db
Nov 25, 2021
ed0edd3
work on intended use
Nov 25, 2021
2ce46eb
work on templates
Nov 26, 2021
e6dede3
co-work with Gabe
Dec 3, 2021
367f21b
some updates
Dec 7, 2021
1b8296c
Merge remote-tracking branch 'origin/main' into 96_vignettes
Dec 7, 2021
aeee055
work in progress
Dec 7, 2021
bb82851
wrap up the beam light concept
Dec 7, 2021
ff5537b
fix error, warnings, notes
Dec 7, 2021
6b56dc8
update pkgdown configuration
Dec 7, 2021
cd362d5
update README
Dec 7, 2021
5513d05
Update vignettes/adam_db_argument.Rmd
waddella Dec 8, 2021
45890fd
Update vignettes/adam_db_argument.Rmd
waddella Dec 8, 2021
e576699
Update vignettes/layouts.Rmd
waddella Dec 8, 2021
75429cd
Update vignettes/layouts.Rmd
waddella Dec 8, 2021
ebcc140
work on typos and linting
Dec 8, 2021
250ef2d
remove trailing whitespaces
Dec 8, 2021
3aba313
yet more trailing whitespace removal
Dec 8, 2021
a61af3b
address more superlinter issues
Dec 8, 2021
3215bff
more superlinter issues
Dec 8, 2021
f0351c2
...
Dec 8, 2021
8095288
more linter issues addressed
Dec 8, 2021
24bb155
more lintr issues
Dec 8, 2021
6018f0d
add a modified standard
Dec 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ Imports:
rlang,
rtables,
tidyr,
tibble
tibble,
methods
Suggests:
DiagrammeR,
DiagrammeRsvg,
knitr,
rmarkdown,
scda,
scda.2021
scda.2021,
purrr
VignetteBuilder:
knitr
Encoding: UTF-8
Expand Down
11 changes: 9 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export(aet03_1)
export(aet03_1_lyt)
export(aet04_1)
export(aet04_1_lyt)
export(append_to_pmap)
export(assert_colnames)
export(bol_YN)
export(cut_by_group)
Expand All @@ -28,10 +29,14 @@ export(ext01_2_lyt)
export(lbt01_1)
export(lbt01_1_lyt)
export(pivot_wider_labels)
export(pmap_row)
export(preprocess_data)
export(remove_tlg_pmap)
export(reorder_levels_params)
export(std_deco)
export(std_filter)
export(std_mutate)
export(std_filter_fun)
export(std_mutate_fun)
export(std_pmap)
export(syn_test_data)
export(var_labels_for)
import(dm)
Expand All @@ -45,7 +50,9 @@ importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(magrittr,"%>%")
importFrom(methods,is)
importFrom(rlang,sym)
importFrom(rtables,var_labels)
importFrom(stats,setNames)
importFrom(tibble,tribble)
importFrom(tidyr,pivot_wider)
20 changes: 3 additions & 17 deletions R/aet02.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
#' library(rtables)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adae)
#'
#' db <- db %>%
#' (std_filter("aet02_1"))() %>%
#' (std_mutate("aet02_1"))()
#' preprocess_data("aet02_1")
#'
#' aet02_1(adam_db = db) %>% head(15)
#'
Expand Down Expand Up @@ -96,7 +92,6 @@ aet02_1 <- function(adam_db,
#' @param lbl_AEBODSYS (`string`) text label for AEBODSYS.
#' @param lbl_AEDECOD (`string`) text label for AEDECOD.
#'
#' @return
#' @export
#'
#' @examples
Expand Down Expand Up @@ -180,11 +175,8 @@ aet02_1_lyt <- function(armvar = .study$armvar,
#' library(rtables)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adae)
#' preprocess_data("aet02_2")
#'
#' db <- db %>%
#' (std_filter("aet02_2"))() %>%
#' (std_mutate("aet02_2"))()
#'
#' aet02_2(db) %>% head(15)
#'
Expand Down Expand Up @@ -255,7 +247,6 @@ aet02_2 <- function(adam_db,
#' @param lbl_AEHLT (`string`) text label for AEHLT.
#' @param lbl_AEDECOD (`string`) text label for AEDECOD.
#'
#' @return
#' @export
#'
#' @examples
Expand Down Expand Up @@ -356,11 +347,7 @@ aet02_2_lyt <- function(armvar = .study$armvar,
#' library(dm)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adae)
#'
#' db <- db %>%
#' (std_filter("aet02_3"))() %>%
#' (std_mutate("aet02_3"))()
#' preprocess_data("aet02_3")
#'
#' aet02_3(adam_db = db) %>% head()
#'
Expand Down Expand Up @@ -406,7 +393,6 @@ aet02_3 <- function(adam_db,
#'
#' @param lbl_AEDECOD (`string`) text label for AEDECOD.
#'
#' @return
#' @export
#'
#' @examples
Expand Down
19 changes: 8 additions & 11 deletions R/aet03.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
#' library(rtables)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adae)
#'
#' db <- db %>%
#' (std_filter("aet03_1"))() %>%
#' (std_mutate("aet03_1"))()
#' preprocess_data("aet03_1")
#'
#' aet03_1(db)
#' aet03_1(db, lbl_overall = "All Patients")
Expand Down Expand Up @@ -94,15 +90,16 @@ aet03_1 <- function(adam_db,
#' @param lbl_AEDECOD (`string`) text label for AEDECOD.
#' @param severity_grade (`vector of strings`) describing the severity levels present in the data set.
#'
#' @return
#' @export
#'
#' @examples
#' aet03_1_lyt(armvar = "ACTARM",
#' lbl_AEBODSYS = "Body System or Organ Class",
#' lbl_AEDECOD = "Dictionary-Derived Term",
#' lbl_overall = NULL,
#' deco = std_deco("AET03"))
#' aet03_1_lyt(
#' armvar = "ACTARM",
#' lbl_AEBODSYS = "Body System or Organ Class",
#' lbl_AEDECOD = "Dictionary-Derived Term",
#' lbl_overall = NULL,
#' deco = std_deco("AET03")
#' )
aet03_1_lyt <- function(armvar = .study$armvar,
lbl_AEBODSYS = "",
lbl_AEDECOD = "",
Expand Down
7 changes: 1 addition & 6 deletions R/aet04.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
#' library(rtables)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adae)
#'
#' db <- db %>%
#' (std_filter("aet03_1"))() %>%
#' (std_mutate("aet03_1"))()
#' preprocess_data("aet03_1")
#'
#' aet04_1(db)
#' aet04_1(db, prune_0 = FALSE)
Expand Down Expand Up @@ -103,7 +99,6 @@ aet04_1 <- function(adam_db,
#' @param lbl_AEDECOD (`string`) text label for AEDECOD.
#' @param group_grades (`list`) putting in correspondence severity levels and labels.
#'
#' @return
#' @export
#'
#' @examples
Expand Down
9 changes: 1 addition & 8 deletions R/dmt01.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@
#' @examples
#'
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl)
#'
#' db <- db %>%
#' (std_filter("dmt01_1"))() %>%
#' (std_mutate("dmt01_1"))()
#'
#' preprocess_data("dmt01_1")
#'
#' dmt01_1(db, summaryvars = c("AGE", "RACE", "SEX", "BWGHTSI"))
#' dmt01_1(db, summaryvars = c("AGE", "RACE", "SEX"), lbl_overall = NULL)
Expand Down Expand Up @@ -82,7 +76,6 @@ dmt01_1 <- function(adam_db,
#' @param summaryvars (`vector of strings`) variables summarized in demographic table.
#' @param summaryvars_lbls (`vector of strings`) labels corresponding to the analyzed variables.
#'
#' @return
#' @export
#'
#' @examples
Expand Down
27 changes: 4 additions & 23 deletions R/dst01.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,18 @@ check_dst01_1_args <- function(reason, status, status_treatment) {
#' @examples
#'
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl)
#'
#' db <- db %>%
#' (std_filter("dst01_1"))() %>%
#' (std_mutate("dst01_1"))()
#' preprocess_data("dst01_1")
#'
#' dst01_1(db)
#'
#'
dst01_1 <- function(adam_db,
armvar = .study$armvar,
status_var = "EOSSTT",
disc_reason_var = .study$disc_reason_var,
lbl_overall = .study$lbl_overall,
prune_0 = TRUE,
lbl_overall = .study$lbl_overall,
deco = std_deco("DST01"),
.study = list(
armvar = "ARM",
Expand Down Expand Up @@ -134,7 +128,6 @@ dst01_1 <- function(adam_db,
#' @details Since the two parts of the tables are pruned differently, the layout function returns a list of layouts,
#' which allows the tables to be constructed and pruned separately before binding.
#'
#' @return
#' @export
#'
#' @examples
Expand Down Expand Up @@ -223,14 +216,9 @@ dst01_1_lyt <- function(armvar = .study$armvar,
#'
#' @examples
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl)
#'
#' db <- db %>%
#' (std_filter("dst01_2"))() %>%
#' (std_mutate("dst01_2"))()
#' preprocess_data("dst01_2")
#'
#' dst01_2(db)
#' dst01_2(db, lbl_overall = NULL)
Expand Down Expand Up @@ -310,7 +298,6 @@ dst01_2 <- function(adam_db,
#' @details Since the two parts of the tables are pruned differently, the layout function returns a list of layouts,
#' which allows the tables to be constructed and pruned separately before binding.
#'
#' @return
#' @export
#'
#' @examples
Expand Down Expand Up @@ -403,14 +390,9 @@ dst01_2_lyt <- function(armvar = .study$armvar,
#'
#' @examples
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl)
#'
#' db <- db %>%
#' (std_filter("dst01_3"))() %>%
#' (std_mutate("dst01_3"))()
#' preprocess_data("dst01_3")
#'
#' dst01_3(db)
#' dst01_3(db, lbl_overall = NULL)
Expand Down Expand Up @@ -516,7 +498,6 @@ dst01_3 <- function(adam_db,
#' @param ongoing_lbl (`string`) associated with ongoing treatment and found in the columns given by `status_treatment`.
#' By Default `ONGOING.
#'
#' @return
#' @export
#'
#' @examples
Expand Down
15 changes: 2 additions & 13 deletions R/ext01.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@
#' @examples
#'
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adex)
#'
#' db <- db %>%
#' (std_filter("ext01_1"))() %>%
#' (std_mutate("ext01_1"))()
#' preprocess_data("ext01_1")
#'
#' ext01_1(db)
#'
Expand Down Expand Up @@ -70,7 +65,6 @@ ext01_1 <- function(adam_db,
#' @param summaryvars `(string)` the name of the variable to be analyzed. By default `"AVAL"`.
#' @param summaryvars_lbls `(string)` the label associated with the analyzed variable.
#'
#' @return
#' @export
#'
ext01_1_lyt <- function(armvar = .study$armvar,
Expand Down Expand Up @@ -121,11 +115,7 @@ ext01_1_lyt <- function(armvar = .study$armvar,
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adex)
#'
#' db <- db %>%
#' (std_filter("ext01_2"))() %>%
#' (std_mutate("ext01_2"))()
#' preprocess_data("ext01_2")
#'
#' ext01_2(db)
#'
Expand Down Expand Up @@ -170,7 +160,6 @@ ext01_2 <- function(adam_db,
#' @param summaryvars (`string`) the name of the variable to be analyzed. By default `"AVAL"`.
#' @param summaryvars_lbls (`string`) the label associated with the analyzed variable.
#'
#' @return
#' @export
#'
ext01_2_lyt <- function(armvar = .study$armvar,
Expand Down
30 changes: 4 additions & 26 deletions R/gen_args.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,17 @@
#' @param lbl_overall (`character`) label used for overall column, if set to `NULL` the overall column is omitted
#' @param prune_0 (`logical`) remove 0 count rows
#' @param .study (`list`) with default values for the arguments of the function
#' @param ad_bl (`data.frame`) subject baseline Dataset with one row per patient
#' @param adsl (`data.frame`) Subject Level Analysis Dataset
#' @param adeg (`data.frame`) ECG Analysis Dataset
#' @param adae (`data.frame`) Adverse Events Analysis Dataset
#' @param adcm (`data.frame`) Concomitant Medications Analysis Dataset
#' @param admh (`data.frame`) Medical History Analysis Dataset
#' @param aag (`data.frame`) Adverse Event Grouping Defs Dataset
#' @param advs (`data.frame`) Vital Signs Analysis Dataset
#' @param adlb (`data.frame`) Laboratory Analysis Dataset
#' @param adex (`data.frame`) Exposure Analysis Dataset
#' @param adsub (`data.frame`) Subcategory Analysis Dataset
#' @param adrs (`data.frame`) Response Analysis Dataset
#' @param adtte (`data.frame`) Time to Event Analysis Dataset
#' @param adhy (`data.frame`) Hy's Law Analysis Dataset
#' @param adsaftte (`data.frame`) Safety Time to Event Analysis Dataset
#' @param addv (`data.frame`) Protocol Deviations Analysis Dataset
#' @param adcssrs (`data.frame`) C-SSRS Analysis Dataset
#' @param adqlqc (`data.frame`) EORTC QLQ-C30 V3 Analysis Dataset
#' @param acg (`data.frame`) Concomitant Med. Grouping Defs Dataset
#' @param adic (`data.frame`) Interval Censoring Analysis Dataset
#'
#' @param tlgfname (`character`) function name of tlg-function
#' @param pmap ('data frame') preprocessing map, see `std_pmap` for the required format
#' @param group (`list of lists`) for group-dependent data binning
#'
#' @param group nest list for group-dependent data binning
#'
#' @details the following arguments are better provided through the study object:
#' - lbl_overall
#' - armvar
#'
gen_args <- function(
adam_db, armvar, lbl_overall, prune_0, deco, .study,
ad_bl, adsl, adeg, adae, adcm, admh, aag, advs, adlb, adex, adsub, adrs, adtte,
adhy, adsaftte, addv, adcssrs, adqlqc, acg, adic, group
adam_db, armvar, lbl_overall, prune_0, deco, .study, group,
tlgfname, pmap
) {
NULL
}
8 changes: 1 addition & 7 deletions R/lbt01.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@
#'
#' @examples
#' library(dm)
#' library(dplyr)
#'
#' db <- syn_test_data() %>%
#' dm_select_tbl(adsl, adlb)
#'
#' db <- db %>%
#' (std_filter("lbt01_1"))() %>%
#' (std_mutate("lbt01_1"))()
#' preprocess_data("lbt01_1")
#'
#' lbt01_1(db)
#'
Expand Down Expand Up @@ -78,7 +73,6 @@ lbt01_1 <- function(adam_db,
#' @param lbl_AVISIT (`character`) label of the `visitvar` variable.
#' @param lbl_PARAM (`character`) label of the `PARAM` variable.
#'
#' @return
#' @export
lbt01_1_lyt <- function(armvar = .study$armvar,
summaryvars = c("AVAL", "CHG"),
Expand Down
Loading