Skip to content

Commit

Permalink
spellcheck and styler run
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfessorP-beep committed Oct 2, 2024
1 parent 6ff41a3 commit fa79598
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
</details>

# admiral 1.1.1
- `derive_vars_atc()` and `create_single_dose_dataset()` `by_vars` argument updated to use `get_admiral_option("subject_keys")` instead of hardcoded USUBJID or STUDYID.
- test scripts, R, and Rmd files for `create_single_dose_dataset` and `occds.Rmd` updated to include a STUDYID column because of `get_admiral_option("subject_keys")` update above.
- `derive_vars_atc()` and `create_single_dose_dataset()` `by_vars` argument updated to use `get_admiral_option("subject_keys")` instead of USUBJID or STUDYID.
- test scripts, R, and markdown files for `create_single_dose_dataset` and `occds.Rmd` updated to include a `STUDYID` column because of `get_admiral_option("subject_keys")` update above.
- `derive_extreme_event()` was fixed such that `check_type = "none"` is accepted
again. (#2462)

Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-create_single_dose_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ test_that("create_single_dose_dataset Test 3: Works for different treatments", {
input,
start_datetime = ASTDTM,
end_datetime = AENDTM,
keep_source_vars = exprs(!!!get_admiral_option("subject_keys"),
EXDOSFRQ, ASTDT, ASTDTM, AENDT, AENDTM, EXTRT)
keep_source_vars = exprs(
!!!get_admiral_option("subject_keys"),
EXDOSFRQ, ASTDT, ASTDTM, AENDT, AENDTM, EXTRT
)
),
expected_output,
keys = c("EXTRT", "ASTDT")
Expand Down
20 changes: 11 additions & 9 deletions tests/testthat/test-derive_vars_transposed.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dataset <- tibble::tribble(
~STUDYID, ~USUBJID, ~VAR1,
"STUDY01", "P01", 3,
"STUDY01", "P02", 31,
"STUDY01", "P03", 42
"STUDY01", "P01", 3,
"STUDY01", "P02", 31,
"STUDY01", "P03", 42
)
dataset_merge <- tibble::tribble(
~STUDYID, ~USUBJID, ~TESTCD, ~VALUE,
"STUDY01", "P01", "T01", 31,
"STUDY01", "P01", "T02", 5,
"STUDY01", "P02", "T01", 3,
"STUDY01", "P03", "T02", 9
"STUDY01", "P01", "T01", 31,
"STUDY01", "P01", "T02", 5,
"STUDY01", "P02", "T01", 3,
"STUDY01", "P03", "T02", 9
)

## Test 1: the merge dataset is transposed and merged correctly ----
Expand Down Expand Up @@ -167,6 +167,8 @@ test_that("derive_vars_transposed Test 5: ATC variables are merged properly", {
id_vars = exprs(FAGRPID)
)

expect_dfs_equal(expected_output, actual_output, keys = c("STUDYID", "USUBJID",
"CMDECOD", "ATC4CD"))
expect_dfs_equal(expected_output, actual_output, keys = c(
"STUDYID", "USUBJID",
"CMDECOD", "ATC4CD"
))
})

0 comments on commit fa79598

Please sign in to comment.