Skip to content

Commit

Permalink
Fix lintr warnings
Browse files Browse the repository at this point in the history
so we don't get nagged with annotations on PRs
  • Loading branch information
Bisaloo committed Feb 4, 2022
1 parent 097708f commit 6f2753e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 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

0 comments on commit 6f2753e

Please sign in to comment.