Skip to content

Commit

Permalink
Develop (#52)
Browse files Browse the repository at this point in the history
* release preps 1.1.2

closes #48

Co-authored-by: riccardoporreca <riccardo.porreca@mirai-solutions.com>
  • Loading branch information
fvitalini and riccardoporreca authored Mar 26, 2020
1 parent 562c18c commit 849f144
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Covid19
Title: Covid-19 Data Analysis
Version: 1.1.1
Version: 1.1.2
Authors@R:
c(person("Francesca", "Vitalini", role = c("cre", "aut"),
email = 'francesca.vitalini@mirai-solutions.com'),
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### Covid19 1.1.2 (2020-03-26)

- JHU data source currently deprecated: switch (temporarily) to https://github.com/bumbeishvili/covid19-daily-data (#48). Users are alerted on app launch.

### Covid19 1.1.1 (2020-03-26)

- fix path to data source
- Updated JHU data source filenames.

### Covid19 1.1.0 (2020-03-25)

Expand Down
10 changes: 10 additions & 0 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ app_server <- function(input, output, session) {
fade = FALSE
))
})

# alert popup regarding data source
showModal(modalDialog(
title = "ALERT: Temporary Data Source",
includeMarkdown(system.file("additional_files/alert.md", package = "Covid19")),
footer = modalButton("Dismiss"),
size = "l",
easyClose = TRUE,
fade = FALSE
))
}
6 changes: 4 additions & 2 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ app_ui <- function(request) {
)
),
a(
href = "https://github.com/CSSEGISandData/COVID-19",
# href = "https://github.com/CSSEGISandData/COVID-19",
href = "https://github.com/bumbeishvili/covid19-daily-data",
target = "_blank",
span(
id = "subtitle",
"Data Repository by Johns Hopkins CSSE:",
# "Data Repository by Johns Hopkins CSSE:",
"Data Repository by bumbeishvili:",
textOutput("last_update", inline = TRUE)
)
)
Expand Down
17 changes: 10 additions & 7 deletions R/get_data.R
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Data taken from here https://github.com/CSSEGISandData/COVID-19
# Data taken from here https://github.com/bumbeishvili/covid19-daily-data

#' Data Urls confirmed_timeseries
#' @rdname DataUrls
#'
#' @export
confirmed_timeseries_csv_url <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
confirmed_timeseries_csv_url <- "https://raw.githubusercontent.com/bumbeishvili/covid19-daily-data/master/time_series_19-covid-Confirmed.csv"

#' Data Urls deaths_timeseries_csv_url
#' @rdname DataUrls
#'
#' @export
deaths_timeseries_csv_url <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv"
deaths_timeseries_csv_url <- "https://raw.githubusercontent.com/bumbeishvili/covid19-daily-data/master/time_series_19-covid-Deaths.csv"

#' Data Urls recovered_timeseries_csv_url
#' @rdname DataUrls
#'
#' @export
recovered_timeseries_csv_url <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv"
recovered_timeseries_csv_url <- "https://raw.githubusercontent.com/bumbeishvili/covid19-daily-data/master/time_series_19-covid-Recovered.csv"

#' Data Urls daily_url
#' @rdname DataUrls
Expand Down Expand Up @@ -83,13 +83,16 @@ get_timeseries_full_data <- function() {

confirmed <- get_timeseries_single_data("confirmed") %>%
pivot_longer(cols = starts_with("X"), names_to = "date", values_to = "confirmed") %>%
convert_date()
convert_date() %>%
mutate(confirmed = round(confirmed)) # necessary for worldometers data, which is evenly spread across US states
deaths <- get_timeseries_single_data("deaths") %>%
pivot_longer(cols = starts_with("X"), names_to = "date", values_to = "deaths") %>%
convert_date()
convert_date() %>%
mutate(deaths = round(deaths)) # necessary for worldometers data, which is evenly spread across US states
recovered <- get_timeseries_single_data("recovered") %>%
pivot_longer(cols = starts_with("X"), names_to = "date", values_to = "recovered") %>%
convert_date()
convert_date() %>%
mutate(recovered = round(recovered)) # necessary for worldometers data, which is evenly spread across US states

join_by_cols <- c("Province.State", "Country.Region", "Lat", "Long", "date")

Expand Down
3 changes: 2 additions & 1 deletion R/mod_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ align_country_names <- function(data) {
"Dominican Republic" = "Dominican Rep.",
"UK" = "United Kingdom",
"Gibraltar" = "United Kingdom",
"US" = "United States",
# "US" = "United States",
"USA" = "United States",
"Saint Barthelemy" = "St-Barth\\u00e9lemy", # stringi::stri_escape_unicode("é")

"Faroe Islands" = "Faeroe Is.",
Expand Down
11 changes: 11 additions & 0 deletions inst/additional_files/alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Update of 2020-03-26

[Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE)](https://github.com/CSSEGISandData/COVID-19) is currently changing its data formats, making the current format [deprecated](https://github.com/CSSEGISandData/COVID-19/issues/1250).

While we wait for the new format to be released, we are TEMPORARLY relying on the [work](https://github.com/bumbeishvili/covid19-daily-data) of [bumbeishvili](https://github.com/bumbeishvili), who is maintaining the old JHU CSSE data set format with updates declared as from [worldometers](https://www.worldometers.info/coronavirus/). This is a new project and we cannot guarantee the reliability of the data source. We are, however, grateful to [bumbeishvili](https://github.com/bumbeishvili) for his [work](https://github.com/bumbeishvili/covid19-daily-data).

Stability, compatibility and reliability of data is one of the greatest challenges for data scientists, and in this time of turmoil COVID-19 data is in constant change. We are doing our best to keep up to date with the latest data.

Updates regarding data sources to be expected in the upcoming days, so stay tuned!


0 comments on commit 849f144

Please sign in to comment.