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

Fix 104 #109

Merged
merged 2 commits into from
Jul 22, 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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: epireview
Title: Tools to update and summarise the latest pathogen data from the Pathogen Epidemiology Review Group (PERG)
Version: 1.3.0
Version: 1.3.1
Authors@R: c(
person("Rebecca", "Nash", email = "r.nash@imperial.ac.uk", role = "aut",
comment = c(ORCID = "0000-0002-5213-4364")),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ importFrom(readr,col_double)
importFrom(readr,col_integer)
importFrom(readr,col_logical)
importFrom(readr,read_csv)
importFrom(readr,read_delim)
importFrom(readr,write_csv)
importFrom(scales,squish)
importFrom(stats,na.omit)
Expand All @@ -139,7 +140,6 @@ importFrom(tidyr,pivot_wider)
importFrom(tidyr,replace_na)
importFrom(tm,removeNumbers)
importFrom(utils,globalVariables)
importFrom(utils,read.csv2)
importFrom(validate,"%vin%")
importFrom(validate,confront)
importFrom(validate,summary)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# epireview 1.3.1

* BUG-FIX: Fixes #104 using readr::read_delim to read in parameter type short names

# epireview 1.3.0

* MAJOR RELEASE
Expand Down
9 changes: 5 additions & 4 deletions R/load_epidata.R
Copy link
Collaborator

Choose a reason for hiding this comment

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

Propose that perhaps @sangeetabhatia03 if we have varying delimiters we move all read_csv() to read_delim() so that we can handle multiple delimiters without coding for exceptions. Not urgent, but relates to lowering our dependency footprint and variability in function convention.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ short_parameter_type <- function(x, parameter_type_full, parameter_type_short) {
#' of the outbreaks extracted for this pathogen, where available.
#'
#' @importFrom dplyr left_join
#' @importFrom utils read.csv2
#' @importFrom readr read_delim
#' @importFrom cli cli_alert_info cli_alert_warning cli_abort cli_alert_success
#' @export
load_epidata <- function(pathogen, mark_multiple = TRUE) {
Expand Down Expand Up @@ -138,9 +138,10 @@ load_epidata <- function(pathogen, mark_multiple = TRUE) {
)
articles_everything <- articles
articles <- articles[, cols]

param_names <- read.csv2(
system.file("extdata", "param_name.csv", package = "epireview")

param_names <- read_delim(
system.file("extdata", "param_name.csv", package = "epireview"),
delim = ";"
)
params <- short_parameter_type(
params, param_names$parameter_type_full, param_names$parameter_type_short
Expand Down
Loading