-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
…nts_signal and comments_response
…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
…aractersation i.e 0 if n/u and 1 if y
…f_dict_survey() function
…ed signal ID to match the updated kobo form
…s from event_id to signal_id and c_signal_id to better match the kobo form
There was a problem hiding this 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here its under outbreaks
R/msf_dict_rename_helper.R
Outdated
@@ -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 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
Only 8 columns, I’m fine to add them.
Thoughts?
P
|
but the lines below have like 20 columns |
Oh, snap, nevermind!
P
|
cool will clean up and merge - gracias |
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?