Skip to content

Commit

Permalink
Fixes to keep lintr happier
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardMN committed Oct 11, 2021
1 parent 4eb12da commit 0d8a6e5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions R/Switzerland.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Switzerland <- R6::R6Class("Switzerland",
)
)
},

#' @description Download function to get raw data. Downloads
#' the updated list of CSV files using `download_JSON`, filters
#' that to identify the required CSV files, then uses the parent
Expand All @@ -77,14 +77,14 @@ Switzerland <- R6::R6Class("Switzerland",
download = function() {
message_verbose(
self$verbose,
paste0("Downloading updated URLs from ", self$common_data_urls$main) )
paste0("Downloading updated URLs from ", self$common_data_urls$main))

super$download_JSON()

self$data_urls <-
self$data$raw$main$data$sources$individual$csv$daily %>%
keep(names(.) %in% c('cases', 'test', 'death', 'hosp'))
keep(names(.) %in% c("cases", "test", "death", "hosp"))

super$download()
},

Expand Down Expand Up @@ -117,18 +117,18 @@ Switzerland <- R6::R6Class("Switzerland",
deaths_total = sumTotal)
tests <- self$data$raw$test %>%
filter(geoRegion != "CH", geoRegion != "CHFL", datum_unit == "day") %>%
# note that the data has entries_pos and entries_neg and we're currently
# not using it.
# note that the data has entries_pos and entries_neg and we're
# currently not using it.
select(geoRegion, datum, entries, sumTotal) %>%
rename(level_1_region_code = geoRegion,
date = datum,
tested_new = entries,
tested_total = sumTotal)

self$data$clean <-
full_join(cases, deaths, by=c("date", "level_1_region_code")) %>%
full_join(hosp, by=c("date", "level_1_region_code")) %>%
full_join(tests, by=c("date", "level_1_region_code")) %>%
full_join(cases, deaths, by = c("date", "level_1_region_code")) %>%
full_join(hosp, by = c("date", "level_1_region_code")) %>%
full_join(tests, by = c("date", "level_1_region_code")) %>%
mutate(
level_1_region_code = if_else(
.data$level_1_region_code == "FL",
Expand Down

0 comments on commit 0d8a6e5

Please sign in to comment.