Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dave-lovell
Copy link

@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
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