diff --git a/R/France.R b/R/France.R index 5a20ed70..643f6536 100644 --- a/R/France.R +++ b/R/France.R @@ -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 diff --git a/R/Germany.R b/R/Germany.R index e639cce1..2eba29b6 100644 --- a/R/Germany.R +++ b/R/Germany.R @@ -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 diff --git a/R/India.R b/R/India.R index 36321812..56903124 100644 --- a/R/India.R +++ b/R/India.R @@ -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 diff --git a/R/Italy.R b/R/Italy.R index fc2fca92..30a5b731 100644 --- a/R/Italy.R +++ b/R/Italy.R @@ -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 diff --git a/R/Lithuania.R b/R/Lithuania.R index 68809495..21463288 100644 --- a/R/Lithuania.R +++ b/R/Lithuania.R @@ -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 diff --git a/R/Mexico.R b/R/Mexico.R index 6f529ed3..4c09e291 100644 --- a/R/Mexico.R +++ b/R/Mexico.R @@ -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 diff --git a/R/Netherlands.R b/R/Netherlands.R index 0bfc4dcf..1cafa9a3 100644 --- a/R/Netherlands.R +++ b/R/Netherlands.R @@ -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 diff --git a/R/SouthAfrica.R b/R/SouthAfrica.R index 443607c0..e1b44b8b 100644 --- a/R/SouthAfrica.R +++ b/R/SouthAfrica.R @@ -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 diff --git a/R/Switzerland.R b/R/Switzerland.R index 0f6bcffa..f3124c47 100644 --- a/R/Switzerland.R +++ b/R/Switzerland.R @@ -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 diff --git a/R/UK.R b/R/UK.R index a974ad0c..3bbc2840 100644 --- a/R/UK.R +++ b/R/UK.R @@ -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() { diff --git a/R/USA.R b/R/USA.R index 94772e51..a00b9ece 100644 --- a/R/USA.R +++ b/R/USA.R @@ -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 diff --git a/R/shared-methods.R b/R/shared-methods.R index 741a5002..5e8468ef 100644 --- a/R/shared-methods.R +++ b/R/shared-methods.R @@ -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) }, diff --git a/data-raw/render_available_datasets.R b/data-raw/render_available_datasets.R index 5611e7a7..214d2edc 100644 --- a/data-raw/render_available_datasets.R +++ b/data-raw/render_available_datasets.R @@ -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) diff --git a/data/all_country_data.rda b/data/all_country_data.rda index b7f38a51..bcbcf6c0 100644 Binary files a/data/all_country_data.rda and b/data/all_country_data.rda differ