Skip to content

Commit

Permalink
Merge pull request #47 from nhs-r-community/vector-test
Browse files Browse the repository at this point in the history
Vector test
  • Loading branch information
Lextuga007 authored Mar 21, 2024
2 parents c621143 + 24bb29f commit 46e14db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^_pkgdown\.yml$
^pkgdown$
^\.github$
^NHSRpopulation\.Rproj$
8 changes: 4 additions & 4 deletions R/get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ get_data <- function(data,
fix_invalid = fix_invalid,
var = column
)
} else if (is.atomic(data) && is_postcode_check > 0) {
} else if (is.character(data) && is_postcode_check > 0) {
data_transformed <- NHSRpostcodetools::postcode_data_join(
x = data,
fix_invalid = fix_invalid,
Expand All @@ -73,7 +73,7 @@ get_data <- function(data,

## Generate specific text for the url

if (is.atomic(data) && is_postcode_check == 0 &&
if (is.character(data) && is_postcode_check == 0 &&
is_lsoa_check > 0) {
text <- paste0(
"LSOA11CD IN ('",
Expand Down Expand Up @@ -108,7 +108,7 @@ get_data <- function(data,
dplyr::left_join(
data_transformed
)
} else if (exists("data_transformed") && is.atomic(data)) {
} else if (exists("data_transformed") && is.character(data)) {
pc_data <- data_transformed
}

Expand All @@ -127,7 +127,7 @@ get_data <- function(data,
data_out,
dplyr::join_by({{ column }} == lsoa11cd)
)
} else if (is_postcode_check == 0 && is_lsoa_check > 0 && is.atomic(data)) {
} else if (is_postcode_check == 0 && is_lsoa_check > 0 && is.character(data)) {
data_out <- imd_api(
text = text,
req = req
Expand Down

0 comments on commit 46e14db

Please sign in to comment.