-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 40: Add example test data (#41)
* Add example test data generation in data-raw and as .rda * Make the test data internal * Delete PNAS data (assume copied here from another package) * Revert back to non-internal data * Add data documentation * Move simulated data generation from data-raw to tests/testthat * Add PNAS ebola data in raw xlsx format with script for saving it to rda in data * Remove simulated data from data/ * Clean the ebola column names * Document ebola data * Add readxl and janitor to Suggests * Add newline to end of file * Add ask to cite and spacing change * Change name to "ebola_outbreak_sierra_leone" and document roxygen2 * Fix linter issues * Rename to sierra_leone_ebola_outbreak_data * Use shorter ebola data name, and change code style Former-commit-id: d140527 Former-commit-id: 4ec821ababa950c635bdc96ad43a3dc1def7f70a
- Loading branch information
Showing
9 changed files
with
80 additions
and
8,360 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Ebola linelist data from Fang et al. (2016) | ||
#' | ||
#' Linelist data for the Ebola virus collected in Sierra Leone. If you use this | ||
#' data in your work, please cite the corresponding paper. | ||
#' | ||
#' @format A `tibble` with 8,358 rows and 8 columns: | ||
#' \describe{ | ||
#' \item{id}{Unique identification number for the case} | ||
#' \item{name}{Name as character, omitted} | ||
#' \item{age}{Age as numeric} | ||
#' \item{sex}{Sex as character, either "F", "M" or NA} | ||
#' \item{date_of_symptom_onset}{The date symptoms began} | ||
#' \item{date_of_sample_tested}{The date the sample was tested} | ||
#' \item{district}{The district (ADM2)} | ||
#' \item{chiefdom}{The chiefdom (ADM3)} | ||
#' } | ||
#' @family data | ||
#' @source <https://www.pnas.org/doi/full/10.1073/pnas.1518587113> | ||
"sierra_leone_ebola_data" |
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 was deleted.
Oops, something went wrong.
Binary file not shown.
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,5 @@ | ||
sierra_leone_ebola_data <- | ||
readxl::read_xlsx("data-raw/pnas.1518587113.sd02.xlsx") |> | ||
janitor::clean_names() | ||
|
||
usethis::use_data(sierra_leone_ebola_data, overwrite = TRUE) |
Binary file not shown.
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,15 @@ | ||
set.seed(101) | ||
|
||
meanlog <- 1.8 | ||
sdlog <- 0.5 | ||
obs_time <- 25 | ||
sample_size <- 200 | ||
|
||
sim_obs <- simulate_gillespie() |> | ||
simulate_secondary( | ||
meanlog = meanlog, | ||
sdlog = sdlog | ||
) |> | ||
observe_process() |> | ||
filter_obs_by_obs_time(obs_time = obs_time) %>% | ||
.[sample(seq_len(.N), sample_size, replace = FALSE)] |