Title: | Find a Cold One Near You |
---|---|
Description: | In short, this package is a locator for cool, refreshing beverages. It will find and return the nearest location where you can get a cold one. |
Authors: | Paul Frater [aut, cre] |
Maintainer: | Paul Frater <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.2 |
Built: | 2024-10-18 06:40:04 UTC |
Source: | CRAN |
Takes name and address and formats it into an HTML label. This is a shortcut
helper function that is used in pbr_me
format_leaflet_labels(name, address, city, state, zip)
format_leaflet_labels(name, address, city, state, zip)
name |
Character. Name of the business |
address |
Character. Address of the business |
city |
Character. City name |
state |
Character. State name |
zip |
Character or numeric. Zip code |
An HTML label
This function simply readies the url for use in a GET request
format_pbr_url(location, dist = 100, lim = 50, brand_id = 333)
format_pbr_url(location, dist = 100, lim = 50, brand_id = 333)
location |
Zip code or (portion of) city name |
dist |
Numeric. The distance in miles to search from the location |
lim |
Numeric. The number of results to be returned |
brand_id |
Numeric. The brand ID to be returned |
A url to be passed to pbr_query
These are just helper shortcut functions. get_ip_address
retrieves a computer's IP address from https://ipinfo.io/what-is-my-ip.
This is easier than getting the IP right off local computer because of bogon
IP addresses. get_zip
pulls ZIP code location from https://ipapi.co/
get_ip_address() get_zip()
get_ip_address() get_zip()
Either the IP address that a web browser sees
(get_ip_address
), or a zip code (get_zip
)
This function is used to find the information needed for an entire GET request url based on just the zip code or city name (or regex)
location_query(location)
location_query(location)
location |
Zip code or (portion of) city name |
A data.frame with city name, zip code, lat, and long
A dataset containing the names and locations for the 50 closest retailers closest to ZIP code 53210.
milwaukee
milwaukee
A data.frame with 50 rows and 12 columns
milwaukee <- pbr_me(53210, map = FALSE)
These functions will retrieve and display the locations of the closest
outlets for a cold one. pbr_me
requires a location to be input. This is handy for
when you're going somewhere and want to scout out the available outlets that
sell what you're looking for. pbr_me_asap
is for when you just need a one now and don't
have time to enter your zip code.
pbr_me(location, map = TRUE, ...) pbr_me_asap()
pbr_me(location, map = TRUE, ...) pbr_me_asap()
location |
A zip code, city name, or regular expression of such |
map |
Logical. Output a leaflet map (TRUE, default) or not (FALSE) |
... |
Additional arguments passed on to |
pbr_me
will display a leaflet
map of the
closest retailer locations. If map = FALSE
it will return a data.frame
of the locations. pbr_me_asap
displays a leaflet map of retailer locations
within your current proximity for those moments when you just need a cold one now
A leaflet map displaying closest retailer locations, or (optionally) a data.frame of retailer locations
## Not run: pbr_me(54481) pbr_me_asap() # for when you just don't have time to enter your zip code ## End(Not run)
## Not run: pbr_me(54481) pbr_me_asap() # for when you just don't have time to enter your zip code ## End(Not run)
Query for locations that sell cold ones
pbr_query(location, ...)
pbr_query(location, ...)
location |
Zip code or (portion of) city name |
... |
Additional arguments to be passed to |
A data.frame of retailers