Skip to content
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

Add {epireview} SARS pathogen to core columns and coercion #407

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/coercion.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ is_epiparameter_df <- function(x) {

pathogen <- .unique(x$pathogen, var_name = "pathogen")
# get disease from pathogen lookup
disease <- switch(
pathogen,
disease <- switch(pathogen,
"Marburg virus" = "Marburg Virus Disease",
"Lassa mammarenavirus" = "Lassa fever",
"Ebola virus" = "Ebola Virus Disease",
stop("Pathogen in epireview not recognised", call. = FALSE)
"SARS-CoV" = "Severe Acute Respiratory Syndrome (SARS)",
stop("Pathogen in {epireview} not recognised", call. = FALSE)
)
epi_name <- .unique(x$parameter_type, var_name = "parameter types")
prob_dist <- .unique(x$distribution_type, var_name = "distribution types")
Expand Down
6 changes: 2 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#' A vector of `character` strings with the core column names of the
#' epidemiological parameter data exported by the \pkg{epireview} R package.
#'
#' A subset of data from the World Health Organization Global Tuberculosis
#' Report ...
#'
#' @format ## `epireview_core_cols`
#' A `character` vector with 56 elements
#' A `character` vector with `r length(epiparameter::epireview_core_cols)`
#' elements.
#'
#' The data is taken as the intersection of the column names of each of the
#' disease parameter tables in the \pkg{epireview} R package.
Expand Down
11 changes: 7 additions & 4 deletions data-raw/epireview_core_cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ if (requireNamespace("epireview", quietly = TRUE)) {
epireview_marburg <- epireview::load_epidata("marburg")
epireview_ebola <- epireview::load_epidata("ebola")
epireview_lassa <- epireview::load_epidata("lassa")
epireview_sars <- epireview::load_epidata("sars")

intersect_marburg_ebola <- intersect(
epireview_core_cols <- intersect(
colnames(epireview_marburg$params),
colnames(epireview_ebola$params)
)
epireview_core_cols <- intersect(
intersect_marburg_ebola,
epireview_core_cols,
colnames(epireview_lassa$params)
)
epireview_core_cols <- intersect(
epireview_core_cols,
colnames(epireview_sars$params)
)
usethis::use_data(
epireview_core_cols,
overwrite = TRUE,
version = 3
)
}


Binary file modified data/epireview_core_cols.rda
Binary file not shown.
7 changes: 4 additions & 3 deletions man/epireview_core_cols.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading