From 4e1c26a16871e67879371c963aafbd3477216558 Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Tue, 25 Jun 2024 10:55:02 -0500 Subject: [PATCH] happier linter --- R/epi_df.R | 3 ++- R/utils.R | 6 +++--- man/upcase_snake_case.Rd | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/R/epi_df.R b/R/epi_df.R index c7554b337..5c84e90ff 100644 --- a/R/epi_df.R +++ b/R/epi_df.R @@ -272,7 +272,8 @@ as_epi_df.tbl_df <- function(x, geo_type, time_type, as_of, x <- guess_geo_column_name(x) if (!test_subset(c("geo_value", "time_value"), names(x))) { cli_abort( - "Either columns `geo_value` and `time_value` must be present in `x`, or related columns (see the internal functions `guess_time_column_name()` and/or `guess_geo_column_name()` for a complete list)." + "Either columns `geo_value` and `time_value` must be present in `x`, or related columns (see the internal + functions `guess_time_column_name()` and/or `guess_geo_column_name()` for a complete list)." ) } diff --git a/R/utils.R b/R/utils.R index 3ec3307ea..f14f9b851 100644 --- a/R/utils.R +++ b/R/utils.R @@ -452,11 +452,11 @@ guess_time_type <- function(time_value) { #' "date" -> c("date", "Date") #' "target_date" -> c("target_date", "Target_Date") #' @keywords internal -upcase_snake_case <- function(x) { - X <- strsplit(x, "_") %>% +upcase_snake_case <- function(vec) { + VEC <- strsplit(vec, "_") %>% map(function(name) paste0(toupper(substr(name, 1, 1)), substr(name, 2, nchar(name)), collapse = "_")) %>% unlist() - c(x, X) + c(vec, VEC) } #' rename potential time_value columns diff --git a/man/upcase_snake_case.Rd b/man/upcase_snake_case.Rd index 398f6a0b7..31ecb768c 100644 --- a/man/upcase_snake_case.Rd +++ b/man/upcase_snake_case.Rd @@ -6,7 +6,7 @@ "date" -> c("date", "Date") "target_date" -> c("target_date", "Target_Date")} \usage{ -upcase_snake_case(x) +upcase_snake_case(vec) } \description{ given a vector of characters, add the same values, but upcased, e.g.