diff --git a/R/UK.R b/R/UK.R index 547f4da2..69cd5886 100644 --- a/R/UK.R +++ b/R/UK.R @@ -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 diff --git a/R/processing.R b/R/processing.R index 23a0b2ad..75b63ce1 100644 --- a/R/processing.R +++ b/R/processing.R @@ -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, diff --git a/R/test-DataClass.R b/R/test-DataClass.R index e6f7f2fd..3f4c3695 100644 --- a/R/test-DataClass.R +++ b/R/test-DataClass.R @@ -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 { diff --git a/R/utils.R b/R/utils.R index 6f845b2e..1b8bc619 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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") diff --git a/data-raw/vietnam_codes.R b/data-raw/vietnam_codes.R index bdba31fc..baec3f9f 100644 --- a/data-raw/vietnam_codes.R +++ b/data-raw/vietnam_codes.R @@ -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( @@ -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) )