PostcodesioR icon indicating copy to clipboard operation
PostcodesioR copied to clipboard

`bulk_postcode_lookup()` supports vector and/or `...` input

Open dave-lovell opened this issue 1 year ago • 1 comments

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 avatar Mar 05 '24 12:03 dave-lovell

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

dave-lovell avatar Mar 18 '24 13:03 dave-lovell