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

Update of epidict package to include an EWAR/EBS template #22

Merged
merged 36 commits into from
Mar 6, 2025
Merged

Conversation

pbkeating
Copy link
Member

I've updated the epidict package so that it creates a minimal fake dataset to run the EWAR/EBS template in the sitrep package.
Possible to review and incorporate?

…al variables

Conditionally made specific variables equal NA if variable doesn't need verification or no intervention required
Added random sample for total affected and active case finding totals and took 1 from those for the under 5 affected and under 5 identified by active case finding
…s from event_id to signal_id and c_signal_id to better match the kobo form
Copy link
Member

@aspina7 aspina7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks pat comments for things that need addressing before merge

R/msf_dict.R Outdated
#' - `msf_dict_survey()` supports "Mortality", "Nutrition", "Vaccination_long"
#' and "Vaccination_short" (only used in surveys if `template = TRUE`)
#' - `msf_dict_survey()` supports "Mortality", "Nutrition", "Vaccination_long",
#' "Vaccination_short" (only used in surveys if `template = TRUE`) and "ebs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you have put it under surveys

R/msf_dict.R Outdated
@@ -65,7 +65,7 @@ msf_dict <- function(disease, name = "MSF-outbreak-dict.xlsx", tibble = TRUE,
disease <- get_dictionary(disease, org = "MSF")$outbreak

if (length(disease) == 0) {
stop("disease must be one of 'Cholera', 'Measles', 'Meningitis', or 'AJS'", call. = FALSE)
stop("disease must be one of 'Cholera', 'Measles', 'Meningitis', 'AJS' or 'ebs'", call. = FALSE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here its under outbreaks

@@ -15,7 +15,7 @@
#' @param varnames The name of column that contains variable names. The
#' default set to "data_element_shortname".
#' If `dictionary` is a survey ("Mortality", "Nutrition", "Vaccination_short"
#' or "Vaccination_long") `varnames` needs to be "name"`. Otherwise if using
#' "Vaccination_long" or "EWAR") `varnames` needs to be "name"`. Otherwise if using
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you have used a different name

R/gen_msf_data.R Outdated
)

## create an initials variable of 3 random letters
dis_output$initials <- stringi::stri_rand_strings(nrow(dis_output), 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of stringi please use base as below - this way less dependencies and less problems for me to fix going forward
replicate(nrow(dis_output), paste0(sample(letters, 2, replace = TRUE), collapse = ""))

dis_output$risk_characterisation == "u"] <- 0

## Convert all columns NA when no intervention required
dis_output[dis_output$alert_status == 0, 42:49] <- NA
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please write out var names (below too) - this is not a safe way of ensuring this selects correct columns going forward

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I mention all of them, or just the start name and end name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would say ideally just list all of them - then we dont end up in a headache down the line where the dataset changes order and we need to scratch our heads figuring out which variables we meant to use

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah actually just realised how many variabels that is - you know what just leave it and we can deal with the fallout...

@pbkeating
Copy link
Member Author

pbkeating commented Mar 6, 2025 via email

@aspina7
Copy link
Member

aspina7 commented Mar 6, 2025

Only 8 columns, I’m fine to add them. Thoughts? P

but the lines below have like 20 columns

@pbkeating
Copy link
Member Author

pbkeating commented Mar 6, 2025 via email

@aspina7
Copy link
Member

aspina7 commented Mar 6, 2025

cool will clean up and merge - gracias
also careful when you reply by email it includes your signature which posts your whatsapp number publically on the internet ye fool

@aspina7 aspina7 merged commit f6c9db4 into master Mar 6, 2025
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants