Skip to content

Commit

Permalink
Render documentation, generate available datasets file, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardMN committed Jun 26, 2021
1 parent bb115ca commit 1de2205
Show file tree
Hide file tree
Showing 23 changed files with 72 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/Canada.R
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
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
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
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
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
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
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
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
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

0 comments on commit 1de2205

Please sign in to comment.