Skip to content

Commit

Permalink
Fixed handling of NULL in summary table, completed country data
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardMN committed Jun 26, 2021
1 parent df7993b commit bb115ca
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 3 deletions.
6 changes: 6 additions & 0 deletions R/France.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ France <- R6::R6Class("France",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "tested_new"),
#' @field source_text Plain text description of the source of the data
source_text = "French Public Open Data Platform",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://www.data.gouv.fr/fr/pages/donnees-coronavirus",


#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
6 changes: 6 additions & 0 deletions R/Germany.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Germany <- R6::R6Class("Germany",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "deaths_new"),
#' @field source_text Plain text description of the source of the data
source_text = "Robert Koch-Institut (RKI)",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://hub.arcgis.com/datasets/dd4580c810204019a7b8eb3e0b329dd6_0/explore",


#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/India.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ India <- R6::R6Class("India",
),
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "deaths_new", "recovered_new"),
#' @field source_text Plain text description of the source of the data
source_text = "COVID19India",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://www.covid19india.org",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/Italy.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Italy <- R6::R6Class("Italy",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_total", "deaths_total", "tested_total"),
#' @field source_text Plain text description of the source of the data
source_text = "Department of Civil Protection, Italy",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/pcm-dpc/COVID-19/blob/master/README_EN.md",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
6 changes: 6 additions & 0 deletions R/Lithuania.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ Lithuania <- R6::R6Class("Lithuania",
source_data_cols = c(
"cases_new", "tested_new", "recovered_total", "deaths_new"
),
#' @field source_text Plain text description of the source of the data
source_text = "Lithuanian Statistics Department",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://hub.arcgis.com/datasets/d49a63c934be4f65a93b6273785a8449_0/about",

# Additional attributes specific to the Lithuania functionality
#' @field death_definition which criteria of deaths attributed to
#' COVID to use
Expand Down
5 changes: 5 additions & 0 deletions R/Mexico.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Mexico <- R6::R6Class("Mexico",
),
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "deaths_new"),
#' @field source_text Plain text description of the source of the data
source_text = "Government of Mexico",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://datos.covid-19.conacyt.mx",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/Netherlands.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Netherlands <- R6::R6Class("Netherlands",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "deaths_new", "hosp_new"),
#' @field source_text Plain text description of the source of the data
source_text = "National Institute for Public Health and the Environment (RIVM), Netherlands",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://data.rivm.nl/covid-19/",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/SouthAfrica.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ SouthAfrica <- R6::R6Class("SouthAfrica",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new", "deaths_new", "recovered_new"),
#' @field source_text Plain text description of the source of the data
source_text = "Data Science for Social Impact research group, University of Pretoria",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/dsfsi/covid19za",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/Switzerland.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ Switzerland <- R6::R6Class("Switzerland",
"cases_total",
"tested_total"
),
#' @field source_text Plain text description of the source of the data
source_text = "Open Data, Canton of Zurich",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/openZH/covid_19/",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
5 changes: 5 additions & 0 deletions R/UK.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ UK <- R6::R6Class("UK",
"newPillarOneTestsByPublishDate", "newPillarTwoTestsByPublishDate",
"newPillarThreeTestsByPublishDate", "newPillarFourTestsByPublishDate"
),
#' @field source_text Plain text description of the source of the data
source_text = "Public Health England",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://coronavirus.data.gov.uk/",

#' @description Specific function for getting region codes for UK .
set_region_codes = function() {
Expand Down
5 changes: 5 additions & 0 deletions R/USA.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ USA <- R6::R6Class("USA",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_total", "deaths_total"),
#' @field source_text Plain text description of the source of the data
source_text = "New York Times",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/nytimes/covid-19-data",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tribble
Expand Down
4 changes: 2 additions & 2 deletions R/shared-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ DataClass <- R6::R6Class(
),
data_urls = paste(unlist(self$data_urls), collapse = ", "),
source_data_cols = paste(unlist(self$source_data_cols), collapse = ", "),
source_text = self$source_text,
source_url = self$source_url
source_text = ifelse(is.null(self$source_text), NA, self$source_text),
source_url = ifelse(is.null(self$source_url), NA, self$source_url)
)
return(sum_df)
},
Expand Down
2 changes: 1 addition & 1 deletion data-raw/render_available_datasets.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# render available datasets table

all_country_data <- get_regional_data(render = TRUE)
all_country_data <- get_available_datasets(render = TRUE)
usethis::use_data(all_country_data, overwrite = TRUE)
Binary file modified data/all_country_data.rda
Binary file not shown.

0 comments on commit bb115ca

Please sign in to comment.