-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] - requirement #0.15 'Format of xx.xx (xx.xx, xx.xx)' is not covered by any test - [x] - requirement #0.27 'Refactor active arm' is not covered by any test - [x] - requirement #0.31 'Format of (xx%, xx%)' is not covered by any test - [x] - requirement #0.36 'survival proportion afun' is not covered by any test - [x] - requirement #0.40 'Generate flextable for preview first page' is not covered by any test - [x] - requirement #0.53 'Format of xx.xx (xx.x)' is not covered by any test --------- Signed-off-by: Joe Zhu <[email protected]>
- Loading branch information
Showing
11 changed files
with
121 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
Type: Package | ||
Package: autoslider.core | ||
Title: Slide Automation for Tables, Listings and Figures | ||
Version: 0.1.0.9004 | ||
Version: 0.2.0 | ||
Authors@R: c( | ||
person("Joe", "Zhu", , "[email protected]", role = c("cre", "aut")), | ||
person("Joe", "Zhu", , "[email protected]", role = c("cre", "aut"), | ||
comment = c(ORCID = "0000-0001-7566-2787")), | ||
person("Heng", "Wang", role = "aut"), | ||
person("Yinqi", "Zhao", role = "aut"), | ||
person("Bo", "Ci", role = "aut"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# autoslider.core 0.1.0.9004 | ||
# autoslider.core 0.2.0 | ||
|
||
### New features | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,3 +95,4 @@ tlg | |
yaml | ||
yml | ||
yyyy | ||
ORCID |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Test some functions in helper_functions.R | ||
|
||
Code | ||
mutate_actarm(adsl) | ||
Output | ||
# A tibble: 400 x 63 | ||
STUDYID USUBJID SUBJID SITEID AGE AGEU SEX RACE ETHNIC COUNTRY DTHFL | ||
<chr> <chr> <chr> <chr> <int> <fct> <fct> <fct> <fct> <fct> <fct> | ||
1 AB12345-1 AB12345~ id-128 CHN-3 32 YEARS M ASIAN HISPA~ CHN Y | ||
2 AB12345-2 AB12345~ id-262 CHN-15 35 YEARS M BLAC~ NOT H~ CHN N | ||
3 AB12345-1 AB12345~ id-378 RUS-3 30 YEARS F ASIAN NOT H~ RUS N | ||
4 AB12345-2 AB12345~ id-220 CHN-11 26 YEARS F ASIAN NOT H~ CHN N | ||
5 AB12345-1 AB12345~ id-267 CHN-7 40 YEARS M ASIAN NOT H~ CHN N | ||
6 AB12345-2 AB12345~ id-201 CHN-15 49 YEARS M ASIAN NOT H~ CHN Y | ||
7 AB12345-1 AB12345~ id-45 USA-1 34 YEARS F ASIAN NOT H~ USA N | ||
8 AB12345-2 AB12345~ id-261 USA-1 32 YEARS F ASIAN NOT H~ USA N | ||
9 AB12345-1 AB12345~ id-173 NGA-11 24 YEARS F BLAC~ NOT H~ NGA N | ||
10 AB12345-2 AB12345~ id-307 CHN-1 24 YEARS M ASIAN NOT H~ CHN Y | ||
# i 390 more rows | ||
# i 52 more variables: INVID <chr>, INVNAM <chr>, ARM <fct>, ARMCD <fct>, | ||
# ACTARM <fct>, ACTARMCD <fct>, TRT01P <fct>, TRT01A <fct>, TRT02P <fct>, | ||
# TRT02A <fct>, REGION1 <fct>, STRATA1 <fct>, STRATA2 <fct>, BMRKR1 <dbl>, | ||
# BMRKR2 <fct>, ITTFL <fct>, SAFFL <fct>, BMEASIFL <fct>, BEP01FL <fct>, | ||
# AEWITHFL <fct>, RANDDT <date>, TRTSDTM <dttm>, TRTEDTM <dttm>, | ||
# TRT01SDTM <dttm>, TRT01EDTM <dttm>, TRT02SDTM <dttm>, TRT02EDTM <dttm>, ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Test slides preview | ||
|
||
Code | ||
ret$header$dataset | ||
Output | ||
V1 V2 V3 V4 V5 | ||
1 A: Drug X B: Placebo C: Combination All Patients | ||
|
||
--- | ||
|
||
Code | ||
ret$body$dataset | ||
Output | ||
V1 V2 V3 | ||
1 Sex | ||
2 F 79 (59%) 82 (61.2%) | ||
3 M 55 (41%) 52 (38.8%) | ||
4 Age | ||
5 Median 33.00 35.00 | ||
6 Min - Max 21.0 - 50.0 21.0 - 62.0 | ||
7 Race | ||
8 ASIAN 68 (50.7%) 67 (50%) | ||
9 BLACK OR AFRICAN AMERICAN 31 (23.1%) 28 (20.9%) | ||
10 WHITE 27 (20.1%) 26 (19.4%) | ||
11 AMERICAN INDIAN OR ALASKA NATIVE 8 (6%) 11 (8.2%) | ||
12 MULTIPLE 0 1 (0.7%) | ||
13 NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER 0 1 (0.7%) | ||
14 OTHER 0 0 | ||
15 UNKNOWN 0 0 | ||
V4 V5 | ||
1 | ||
2 70 (53%) 231 (57.8%) | ||
3 62 (47%) 169 (42.2%) | ||
4 | ||
5 35.00 34.00 | ||
6 20.0 - 69.0 20.0 - 69.0 | ||
7 | ||
8 73 (55.3%) 208 (52%) | ||
9 32 (24.2%) 91 (22.8%) | ||
10 21 (15.9%) 74 (18.5%) | ||
11 6 (4.5%) 25 (6.2%) | ||
12 0 1 (0.2%) | ||
13 0 1 (0.2%) | ||
14 0 0 | ||
15 0 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
testthat::test_that("new_round function", { | ||
da1 <- data.frame( | ||
raw = seq(0, 1, 0.0005), | ||
r = unlist(lapply(seq(0, 1, 0.0005) * 100, new_round, digits = 1)) | ||
) | ||
expect_true(all(table(da1$r[2:2001]) == 2)) | ||
|
||
da2 <- data.frame( | ||
raw = seq(0, 1, 0.00005), | ||
r = unlist(lapply(seq(0, 1, 0.00005) * 100, new_round, digits = 2)) | ||
) | ||
expect_true(all(table(da2$r[2:20001]) == 2)) | ||
}) | ||
|
||
|
||
testthat::test_that("xx.xx (xx.xx)", { | ||
expect_identical(trim_perc(c(10, 0.6375)), "10 (63.75)") | ||
}) | ||
|
||
testthat::test_that("xx.xx (xx.x)", { | ||
expect_identical(trim_perc1(c(10, 0.6375)), "10 (63.8)") | ||
}) | ||
|
||
testthat::test_that("(xx\\%, xx\\%)", { | ||
expect_identical(perc_perc(c(0.2, 0.6375)), "20% (64%)") | ||
}) | ||
|
||
testthat::test_that("xx.xx (xx.xx, xx.xx)", { | ||
expect_identical(format_3d(c(10, 0.6375, 0.2413)), "10 (0.64, 0.24)") | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test_that("Test some functions in helper_functions.R", { | ||
testthat::expect_no_error(mutate_actarm(adsl)) | ||
testthat::expect_snapshot(mutate_actarm(adsl)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test_that("Test slides preview", { | ||
adsl <- eg_adsl | ||
out <- t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE")) | ||
expect_no_error(ret <- out %>% slides_preview()) | ||
expect_snapshot(ret$header$dataset) | ||
expect_snapshot(ret$body$dataset) | ||
}) |