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
Prev Previous commit
Next Next commit
Render documentation, generate available datasets file, lint
  • Loading branch information
RichardMN committed Jun 26, 2021
commit 1de2205233b0d741360b7e637dc3997aac491bf0
2 changes: 1 addition & 1 deletion R/Canada.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Canada <- R6::R6Class("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
4 changes: 2 additions & 2 deletions R/Colombia.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ Colombia <- R6::R6Class("Colombia",
#' @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",
source_text = "Daniel C\u00e1rdenas",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/danielcs88/colombia_covid-19/",
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
2 changes: 1 addition & 1 deletion R/Cuba.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Cuba <- R6::R6Class("Cuba",
source_text = "COVID19 Cuba Data team",
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://covid19cubadata.github.io/#cuba",
source_url = "https://covid19cubadata.github.io/#cuba",


#' @description Set up a table of region codes for clean data
Expand Down
2 changes: 1 addition & 1 deletion R/Germany.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Germany <- R6::R6Class("Germany",
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",
source_url = "https://hub.arcgis.com/datasets/dd4580c810204019a7b8eb3e0b329dd6_0/explore", # nolint


#' @description Set up a table of region codes for clean data
Expand Down
2 changes: 1 addition & 1 deletion R/Lithuania.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Lithuania <- R6::R6Class("Lithuania",
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",
source_url = "https://hub.arcgis.com/datasets/d49a63c934be4f65a93b6273785a8449_0/about", # nolint

# Additional attributes specific to the Lithuania functionality
#' @field death_definition which criteria of deaths attributed to
Expand Down
2 changes: 1 addition & 1 deletion R/Netherlands.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Netherlands <- R6::R6Class("Netherlands",
#' @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",
source_text = "National Institute for Public Health and the Environment (RIVM), Netherlands", # nolint
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://data.rivm.nl/covid-19/",
Expand Down
2 changes: 1 addition & 1 deletion R/SouthAfrica.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SouthAfrica <- R6::R6Class("SouthAfrica",
#' @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",
source_text = "Data Science for Social Impact research group, University of Pretoria", # nolint
#' @field source_url Website address for explanation/introduction of the
#' data
source_url = "https://github.com/dsfsi/covid19za",
Expand Down
Binary file modified data/all_country_data.rda
Binary file not shown.
5 changes: 5 additions & 0 deletions man/France.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Germany.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/India.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Italy.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Lithuania.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Mexico.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Netherlands.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/SouthAfrica.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/Switzerland.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/UK.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/USA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/all_country_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testthat/test-DataClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ test_that("DataClass returns a summary", {
names(sum),
c(
"origin", "class", "level_1_region", "level_2_region", "level_3_region",
"type", "data_urls", "source_data_cols"
"type", "data_urls", "source_data_cols", "source_text", "source_url"
)
)
expect_true(sum$class[1] == "D")
Expand Down
9 changes: 7 additions & 2 deletions tests/testthat/test-get_available_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test_that(
expected_names <- c(
"origin", "class", "level_1_region",
"level_2_region", "level_3_region", "type",
"data_urls", "source_data_cols"
"data_urls", "source_data_cols",
"source_text", "source_url"
)
expect_identical(colnames(data), expected_names)
}
Expand Down Expand Up @@ -41,7 +42,11 @@ test_that(

# test each column for na values
for (name in colnames(data)) {
if (name %in% c("level_1_region", "level_2_region", "level_3_region")) {
if (name %in% c("level_1_region",
"level_2_region",
"level_3_region",
"source_text",
"source_url")) {
next
}
test_that(
Expand Down