-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
15 additions
and
37 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
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,6 +1,3 @@ | ||
library(r2rtf) | ||
|
||
|
||
test_that("meta_adam testing", { | ||
test <- meta_adam( | ||
population = r2rtf::r2rtf_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
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,47 +1,45 @@ | ||
library(dplyr) | ||
|
||
test_that("variable 'RACE' checking", { | ||
expect_equal(names(meta_example() |> meta_split("RACE")), sort(unique(meta_example()$data_population$RACE))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = WHITE' checking in data_population", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_population %>% filter(RACE == "WHITE") | ||
z <- meta_example()$data_population %>% dplyr::filter(RACE == "WHITE") | ||
expect_equal(x$WHITE$data_population$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = BLACK OR AFRICAN AMERICAN' checking in data_population", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_population %>% filter(RACE == "BLACK OR AFRICAN AMERICAN") | ||
z <- meta_example()$data_population %>% dplyr::filter(RACE == "BLACK OR AFRICAN AMERICAN") | ||
expect_equal(x$`BLACK OR AFRICAN AMERICAN`$data_population$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = AMERICAN INDIAN OR ALASKA NATIVE' checking in data_population", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_population %>% filter(RACE == "AMERICAN INDIAN OR ALASKA NATIVE") | ||
z <- meta_example()$data_population %>% dplyr::filter(RACE == "AMERICAN INDIAN OR ALASKA NATIVE") | ||
expect_equal(x$`AMERICAN INDIAN OR ALASKA NATIVE`$data_population$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = WHITE' checking in data_observation", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_observation %>% filter(RACE == "WHITE") | ||
z <- meta_example()$data_observation %>% dplyr::filter(RACE == "WHITE") | ||
expect_equal(x$WHITE$data_observation$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = BLACK OR AFRICAN AMERICAN' checking in data_observation", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_observation %>% filter(RACE == "BLACK OR AFRICAN AMERICAN") | ||
z <- meta_example()$data_observation %>% dplyr::filter(RACE == "BLACK OR AFRICAN AMERICAN") | ||
expect_equal(x$`BLACK OR AFRICAN AMERICAN`$data_observation$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) | ||
|
||
|
||
test_that("variable 'RACE = AMERICAN INDIAN OR ALASKA NATIVE' checking in data_observation", { | ||
x <- meta_example() |> meta_split("RACE") | ||
z <- meta_example()$data_observation %>% filter(RACE == "AMERICAN INDIAN OR ALASKA NATIVE") | ||
z <- meta_example()$data_observation %>% dplyr::filter(RACE == "AMERICAN INDIAN OR ALASKA NATIVE") | ||
expect_equal(x$`AMERICAN INDIAN OR ALASKA NATIVE`$data_observation$USUBJID, unlist(as.list(z$USUBJID))) | ||
}) |
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