-
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.
- Loading branch information
Spatiotemporal-Exposures-and-Toxicology
committed
Jan 6, 2024
1 parent
f5ccf07
commit 5169dbb
Showing
2 changed files
with
21 additions
and
2 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,5 +1,4 @@ | ||
url: https://spatiotemporal-exposures-and-toxicology.github.io/GeoToxPackage/ | ||
template: | ||
bootstrap: 5 | ||
bootswatch: sandstone | ||
|
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,24 @@ | ||
test_that("inputs", { | ||
test_that("simulate_age returns errors from bad inputs", { | ||
# errors from bad input | ||
expect_error(simulate_age(data.frame())) | ||
# errors from bad order | ||
expect_error(simulate_age(data.frame(AGEGRP = 0, TOT_POP = 0))) | ||
# | ||
}) | ||
|
||
|
||
test_that("age samples are good", { | ||
|
||
x <- data.frame(AGEGRP = 0:18, TOT_POP = c(sum(1:18), 1:18)) | ||
ages_test <- simulate_age(x, 10) | ||
|
||
|
||
# age sample is of size "n" | ||
expect_vector(ages_test,size = 10) | ||
|
||
# age samples are within allowed age range [0,90] t | ||
expect_true(all(ages_test < 90 & ages_test >= 0)) | ||
|
||
|
||
# | ||
}) |