Objective

We are simply trying to implement the use of leaflet in R for this assignment.

library(leaflet)

Costo near UTSA

#CREATING ICON
Boy_Icon <- makeIcon(
              iconUrl = ('asian.png'),
              iconWidth = 31*215/230,
              iconHeight = 40,
              iconAnchorX = 31*215/230/2,
              iconAnchorY = 16
              )  
# Specify url
Data_Site <- c( "<a href = 'https://www.costco.com/'> Click to shop at Costco.com </a >")


#data widget
  data_Map <- leaflet (width = "100%", height = 300 ) %>%
  addTiles() %>%
  addMarkers( lat = 29.5764, lng = -98.5978,
              icon = Boy_Icon,
              popup = Data_Site )
  
            
data_Map

Sams Club near UTSA

Boy_Icon2 <- makeIcon(
              iconUrl = ('sams.png'),
              iconWidth = 31*215/230,
              iconHeight = 40,
              iconAnchorX = 31*215/230/2,
              iconAnchorY = 16
              )
# Specify url
Data_Site2 <-  c( "<a href = 'https://www.samsclub.com/'> Click to shop at Sams club </a>")

#data widget
  data_Map <- leaflet (width = "100%", height = 300 ) %>%
  addTiles() %>%
  addMarkers( lat = 29.56653000, lng = -98.596222000,
              icon = Boy_Icon2,
              popup = Data_Site2 )
data_Map

Another Example of a food place

content <- paste(sep = "<br/>",
  "<b><a href='http://www.samurainoodle.com'>Samurai Noodle</a></b>",
  "606 5th Ave. S",
  "Seattle, WA 98138"
)

leaflet() %>% addTiles() %>%
  addPopups(-122.327298, 47.597131, content,
    options = popupOptions(closeButton = FALSE)
  )