From 83d2c6cd5a97dd4c8f310676b02b11fc9da7c7ee Mon Sep 17 00:00:00 2001 From: Lextuga007 Date: Thu, 21 Mar 2024 17:46:47 +0000 Subject: [PATCH] Changed is_vector to is_character --- R/postcode_data_join.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/postcode_data_join.R b/R/postcode_data_join.R index 7c4df98..a1efdab 100644 --- a/R/postcode_data_join.R +++ b/R/postcode_data_join.R @@ -25,6 +25,9 @@ postcode_data_join <- function(x, var = "postcode", fix_invalid = TRUE) { autocomp_codes <- NULL remainder <- NULL +# is_character (vector) ------------------------------------------------------ + + var <- rlang::as_string(var) if (is.data.frame(x)) { @@ -37,7 +40,7 @@ postcode_data_join <- function(x, var = "postcode", fix_invalid = TRUE) { dplyr::pull({{ var }}) |> unique() } else { - assertthat::assert_that(rlang::is_vector(x)) + assertthat::assert_that(rlang::is_character(x)) codes <- unique(x) } @@ -164,7 +167,7 @@ postcode_data_join <- function(x, var = "postcode", fix_invalid = TRUE) { dplyr::left_join(postcode_data, by = vctrs::vec_c({{ var }} := "postcode") ) - } else if (rlang::is_vector(x)) { + } else if (rlang::is_character(x)) { tibble::tibble({{ var }} := x) |> dplyr::left_join(postcode_data, by = vctrs::vec_c({{ var }} := "postcode")