-
-
Notifications
You must be signed in to change notification settings - Fork 1
test(JnJ): ✅ Added table_jnj_tbl1 #196
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d02b890
test(JnJ): ✅ Added table_jnj_tbl1
iaugusty 8af512b
Update DESCRIPTION
shajoezhu f389a41
Update DESCRIPTION
shajoezhu e26aa69
Add remote repository for insightsengineering/tern
shajoezhu 88d2119
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] de53b02
Trigger Build
shajoezhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,21 @@ | ||
| # DMT01 variant factor with only Missing values | ||
|
|
||
| Code | ||
| res | ||
| Output | ||
| Placebo Screen Failure Xanomeline High Dose Xanomeline Low Dose | ||
| (N=86) (N=52) (N=72) (N=96) | ||
| —————————————————————————————————————————————————————————————————————————————————————————————————— | ||
| Age (yr) | ||
| n 86 52 72 96 | ||
| Mean (SD) 75.2 (8.6) 75.1 (9.7) 73.8 (7.9) 76.0 (8.1) | ||
| Median 76.0 76.0 75.5 78.0 | ||
| Min - Max 52.0 - 89.0 50.0 - 89.0 56.0 - 88.0 51.0 - 88.0 | ||
| Age Group | ||
| n 86 52 72 96 | ||
| 18-40 0 0 0 0 | ||
| 41-64 14 (16.3%) 9 (17.3%) 11 (15.3%) 8 (8.3%) | ||
| >=65 72 (83.7%) 43 (82.7%) 61 (84.7%) 88 (91.7%) | ||
| Biomarker 1 Categories | ||
| n 0 0 0 0 | ||
|
|
||
This file contains hidden or 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,56 @@ | ||
| # extra special case situation to scenario from test-table_dmt01.R | ||
| # Tests DMT01 with corner case situation to demonstrate bug in analyze is resolved with empty factor data | ||
| # tern@1431-bug-s_summaryfactor | ||
| set.seed(1) | ||
|
|
||
| adsl <- pharmaverseadam::adsl | ||
| adsl <- adsl %>% | ||
| mutate(BMRKR1 = rnorm(nrow(adsl), 3.5, 10)) %>% | ||
| mutate(STRATA1 = factor(sample(c("A", "B", "C"), nrow(adsl), TRUE))) | ||
|
|
||
| adsl <- df_explicit_na(adsl) | ||
|
|
||
| adsl <- adsl %>% | ||
| mutate( | ||
| SEX = factor(case_when( | ||
| SEX == "M" ~ "Male", | ||
| SEX == "F" ~ "Female", | ||
| SEX == "U" ~ "Unknown", | ||
| SEX == "UNDIFFERENTIATED" ~ "Undifferentiated" | ||
| )), | ||
| AGEGR1 = factor( | ||
| case_when( | ||
| between(AGE, 18, 40) ~ "18-40", | ||
| between(AGE, 41, 64) ~ "41-64", | ||
| AGE > 64 ~ ">=65" | ||
| ), | ||
| levels = c("18-40", "41-64", ">=65") | ||
| ), | ||
| BMRKR1_CAT = NA_character_ | ||
| ) %>% | ||
| var_relabel( | ||
| BMRKR1_CAT = "Biomarker 1 Categories" | ||
| ) | ||
|
|
||
| adsl <- df_explicit_na(adsl, na_level = "<Missing>") | ||
|
|
||
|
|
||
| testthat::test_that("DMT01 variant factor with only Missing values", { | ||
| vars <- c("AGE", "AGEGR1", "BMRKR1_CAT") | ||
| var_labels <- c( | ||
| "Age (yr)", | ||
| "Age Group", | ||
| "Biomarker 1 Categories" | ||
| ) | ||
|
|
||
| result <- basic_table(show_colcounts = TRUE) %>% | ||
| split_cols_by(var = "ACTARM") %>% | ||
| analyze_vars( | ||
| vars = vars, | ||
| var_labels = var_labels | ||
| ) %>% | ||
| build_table(adsl) | ||
|
|
||
| res <- testthat::expect_silent(result) | ||
| testthat::expect_snapshot(res) | ||
| }) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.