Description Usage Arguments Details Value Examples
View source: R/get_establishments.R
Fetches a list of establishments
1 2 |
name |
A string to search for within the business name |
la |
The ID of the required local authority (as returned from 'get_authorities()') |
type |
The code of the required business type (as returned from 'get_business_types()') |
condensed |
By default the function returns a selection of variables: to return everything in the API call, set this to FALSE |
'get_establishments' makes an API call that returns all establishments, with the ability to filter by name, local authority and business type.
A tibble containing all businesses that meet the specified criteria
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
library(dplyr)
# A list of all restaurants in Aberdeen
# Find the code for Aberdeen
get_authorities() %>%
filter(grepl("Aberdeen", name))
# Find the code for restaurants
get_business_types()
# Perform establishment search
get_establishments(la = 197, type = 1)
# A list of all businesses containing the words "pret a manger" in Birmingham
# Find out the code for Birmingham
get_authorities() %>%
filter(grepl("Birmingham", name))
# Perform establishment search
get_establishments(name = "pret a manger", la = 374)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.