Skip to content

Commit

Permalink
Merge branch 'master' into fix-colombia-data-430-require-rsocrata
Browse files Browse the repository at this point in the history
  • Loading branch information
kathsherratt authored Feb 4, 2022
2 parents 7a00270 + 2bec63f commit 07e27d9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion R/UK.R
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ UK <- R6::R6Class("UK",
#' Section 2, "2. Estimated new hospital cases"
#' @importFrom lubridate year month
#' @importFrom readxl read_excel cell_limits
#' @importFrom dplyr mutate select %>% group_by summarise left_join as_tibble
#' @importFrom dplyr mutate select %>% group_by summarise left_join
#' @importFrom dplyr as_tibble
#' @importFrom tidyr pivot_longer
#' @param clean_data Cleaned UK covid-19 data
#' @param nhs_data NHS region data
Expand Down
4 changes: 2 additions & 2 deletions R/processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ run_optional_processing_fns <- function(data, process_fns) {
#' processing steps
#' @concept utility
#' @family processing
#' @importFrom dplyr do group_by_at across ungroup select everything arrange all_of
#' @importFrom dplyr rename
#' @importFrom dplyr do group_by_at across ungroup select everything arrange
#' @importFrom dplyr rename all_of
#' @importFrom tidyr drop_na
#' @importFrom rlang !!!
process_internal <- function(clean_data, level, group_vars,
Expand Down
2 changes: 1 addition & 1 deletion R/test-DataClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ test_download <- function(DataClass_obj, download, snapshot_path) {
)
DataClass_obj$data$raw <- map(
DataClass_obj$data$raw,
~ .[, 1:min(100, ncol(.))]
~ .[, seq_len(min(100, ncol(.)))]
)
saveRDS(DataClass_obj$data$raw, snapshot_path)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,6 @@ make_new_data_source <- function(source, type = "subnational",
make_github_workflow(source)
}

# Hack to work around the fact that `where()` is not exported
# Hack to work around the fact that `where()` is not exported
# (https://github.com/r-lib/tidyselect/issues/201)
utils::globalVariables("where")
4 changes: 2 additions & 2 deletions data-raw/vietnam_codes.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ library(tibble)
vn_iso <- "https://en.wikipedia.org/wiki/ISO_3166-2:VN"

level_1_region_df <- read_html(vn_iso) %>%
html_element(css="table.wikitable:nth-child(11)") %>%
html_element(css = "table.wikitable:nth-child(11)") %>%
html_table()

vietnam_codes <- data.frame(
Expand All @@ -25,7 +25,7 @@ vietnam_codes <- data.frame(
mutate(
level_1_region = stri_trans_general(level_1_region, "latin-ascii"),
level_1_region = stri_trim_both(level_1_region),
level_1_region = str_replace_all(level_1_region, '\\(.*\\)|-| ', ''),
level_1_region = str_replace_all(level_1_region, "\\(.*\\)|-| ", ""),
level_1_region = str_to_title(level_1_region)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test_that("complete_cumulative_columns works", {
input_data <- get_input_data_for_complete_cumulative_columns_test()
expected_data <- get_expected_data_for_complete_cumulative_columns_test()
actual_data <- complete_cumulative_columns(input_data)
expect_equal(colnames(actual_data), colnames(expected_data))
expect_equal(sort(colnames(actual_data)), sort(colnames(expected_data)))
expect_true(!any(is.na(actual_data$cases_total)))
})

Expand Down

0 comments on commit 07e27d9

Please sign in to comment.