PBR Me

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(pbr)
library(htmltools)

Been a hard day of analysis? In the lab? Programming Shiny apps? Making data visualizations? Maybe you just finished your defense and want to go celebrate. Either way, you need a cold one, and you need it now. The pbr package makes it easy for you to find the closest place to get an ice cold brew. Simply use the pbr_me function along with your ZIP code or city name and a dynamic map will appear with the nearest places to find one.

pbr_me("Milwaukee, WI")

ZIP codes are perhaps a bit more dependable

pbr_me(53210)

\

PBR me ASAP

Need a cold brew now and it just can't wait? Are you too thirsty to remember what your ZIP code or current location is? No problem...just pbr_me_asap.

pbr_me_asap()
format_leaf_lab <- function(name, address, city, state, zip) {
  out <- paste(
    "<strong>", name, "</strong>",
    "<br>",
    address,
    "<br>",
    paste0(city, ", ", state, " ", zip)
  )
  return(lapply(out, htmltools::HTML))
}
leaflet::leaflet(data = milwaukee) |>
  leaflet::addTiles() |>
  leaflet::addMarkers(
    ~lon, ~lat,
    label = ~format_leaf_lab(name, address, city, state, zip)
  )


Try the pbr package in your browser

Any scripts or data that you put into this service are public.

pbr documentation built on Aug. 25, 2023, 5:14 p.m.