Skip to content

bulk_postcode_lookup() supports vector and/or ... input#19

Open
dave-lovell wants to merge 3 commits intoropensci:masterfrom
dave-lovell:master
Open

bulk_postcode_lookup() supports vector and/or ... input#19
dave-lovell wants to merge 3 commits intoropensci:masterfrom
dave-lovell:master

Conversation

@dave-lovell
Copy link
Copy Markdown

@dave-lovell dave-lovell commented Mar 5, 2024

bulk_postcode_lookup() used to only work accept this syntax:

bulk_postcode_lookup(list(postcodes = c("PR30SG", "M456GN", "EX165BL"))

But now it also supports this syntax:

## Postcodes can be provided as individual arguments
bulk_postcode_lookup("PR30SG", "M456GN", "EX165BL")
## Or as one or more vectors:
bulk_postcode_lookup(c("PR30SG", "M456GN"), "EX165BL")

The main change is only a couple of lines:

bulk_postcode_lookup <- function(...) {
  dots <- unlist(c(...), recursive = TRUE)
  postcodes <- list(postcodes = dots)
#...
}

@dave-lovell
Copy link
Copy Markdown
Author

@Erzk are you able to review this? Happy to amend if you think another approach is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant