diff --git a/priority-pathogens.Rproj b/priority-pathogens.Rproj index 8e3c2ebc..21a4da08 100644 --- a/priority-pathogens.Rproj +++ b/priority-pathogens.Rproj @@ -11,3 +11,7 @@ Encoding: UTF-8 RnwWeave: Sweave LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/shared/lassa_functions.R b/shared/lassa_functions.R index 8646f330..5f331d7e 100644 --- a/shared/lassa_functions.R +++ b/shared/lassa_functions.R @@ -232,13 +232,9 @@ metaprop_wrap <- function(dataframe, subgroup, plot_pooled, sort_by_subg, plot_study, digits, colour, width, height, resolution){ - stopifnot(length(unique(dataframe$parameter_unit[!is.na(dataframe$parameter_unit)])) == 1)#values must have same units - - dataframe <- dataframe %>% filter(!is.na(cfr_ifr_denominator)) %>% - filter(!(is.na(cfr_ifr_numerator)&is.na(parameter_value))) %>% - mutate(cfr_ifr_numerator = case_when( - is.na(cfr_ifr_numerator) & !is.na(parameter_value) ~ round((parameter_value/100)*cfr_ifr_denominator), - TRUE ~ cfr_ifr_numerator)) + dataframe <- epireview::filter_df_for_metaprop(dataframe, + num_col = "cfr_ifr_numerator", + denom_col = "cfr_ifr_denominator") mtan <- metaprop(data = dataframe, studlab = refs, diff --git a/src/lassa_severity/orderly.R b/src/lassa_severity/orderly.R index f13ba349..94613470 100644 --- a/src/lassa_severity/orderly.R +++ b/src/lassa_severity/orderly.R @@ -17,6 +17,12 @@ library(png) library(grid) library(patchwork) library(gridExtra) +if(packageVersion("epireview") < "1.1.3") { + error_msg <- + paste("Please download the latest development version of epireview using:", + "devtools::install_github('mrc-ide/epireview@develop')") + stop(error_msg) +} #orderly preparation orderly_strict_mode()