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

Add source text and url fields to classes #388

Merged
merged 6 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Adjusted summary method, began adding source text and url fields
  • Loading branch information
RichardMN committed Jun 24, 2021
commit 00fd919d4537a790326357fd38808ff53e61ab1c
5 changes: 5 additions & 0 deletions R/Belgium.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ Belgium <- R6::R6Class("Belgium",
),
#' @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 = "Sciensano (Belgian institute of health)",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://epistat.wiv-isp.be/covid/",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble tribble
Expand Down
5 changes: 5 additions & 0 deletions R/Brazil.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ Brazil <- R6::R6Class("Brazil",
),
#' @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 = "Wesley Cota",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/wcota/covid19br/blob/master/README.en.md",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tribble
Expand Down
7 changes: 6 additions & 1 deletion R/Canada.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ Canada <- R6::R6Class("Canada",
"cases_new", "cases_total", "deaths_new",
"recovered_total", "tested_new"
),

#' @field source_text Plain text description of the source of the data
source_text = "Public Health Infobase, Public Health Agency of Canada",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://open.canada.ca/data/en/dataset/261c32ab-4cfd-4f81-9dea-7b64065690dc", # nolint

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
set_region_codes = function() {
Expand Down
5 changes: 5 additions & 0 deletions R/Colombia.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ Colombia <- R6::R6Class("Colombia",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_total"),
#' @field source_text Plain text description of the source of the data
source_text = "Daniel Cárdenas",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/danielcs88/colombia_covid-19/",

#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
6 changes: 6 additions & 0 deletions R/Cuba.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ Cuba <- R6::R6Class("Cuba",
# nolint end
#' @field source_data_cols existing columns within the raw data
source_data_cols = c("cases_new"),
#' @field source_text Plain text description of the source of the data
source_text = "COVID19 Cuba Data team",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://covid19cubadata.github.io/#cuba",


#' @description Set up a table of region codes for clean data
#' @importFrom tibble tibble
Expand Down
4 changes: 3 additions & 1 deletion R/shared-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ DataClass <- R6::R6Class(
"national", "regional"
),
data_urls = paste(unlist(self$data_urls), collapse = ", "),
source_data_cols = paste(unlist(self$source_data_cols), collapse = ", ")
source_data_cols = paste(unlist(self$source_data_cols), collapse = ", "),
source_text = self$source_text,
source_url = self$source_url
)
return(sum_df)
},
Expand Down