#install.packages(c("tidygeocoder", "dplyr", "leaflet"))
library(tidygeocoder)library(dplyr)library(leaflet)
# Museum names including important museums from specified countriesmuseums <- tibble::tibble( name = c( # New York Museums "The Metropolitan Museum of Art", "Museum of Modern Art", "Solomon R. Guggenheim Museum", "The Frick Collection", "American Museum of Natural History", "Museum of the City of New York", "Tenement Museum", "National September 11 Memorial & Museum", "Intrepid Sea, Air & Space Museum", "Museum of Mathematics", "Cooper Hewitt, Smithsonian Design Museum", "El Museo del Barrio", "Jewish Museum", "International Center of Photography", "Museum of Chinese in America", "National Museum of the American Indian", "Museum of the Moving Image", "Neue Galerie", # England "British Museum", "Tate Modern", "Victoria and Albert Museum", # Spain "Museo Nacional del Prado", "Museo Reina Sofía", "Guggenheim Bilbao", # France "Louvre Museum", "Musée d'Orsay", "Centre Pompidou", # Germany "Pergamon Museum", "Alte Pinakothek", "German Historical Museum", # Belgium "Royal Museums of Fine Arts of Belgium", "Magritte Museum", # Norway "Munch Museum", "National Museum Oslo", # Italy "Uffizi Gallery", "Vatican Museums", "Galleria Borghese", # Japan "Tokyo National Museum", "Mori Art Museum", # South Korea "National Museum of Korea", "Leeum, Samsung Museum of Art", # Mexico City "Museo Nacional de Antropología", "Museo Frida Kahlo", "Palacio de Bellas Artes", # Aguascalientes "Museo José Guadalupe Posada", "Museo Espacio" ))
# Geocode museum namesmuseum_locations <- museums %>% geocode(name, method = "osm", full_results = FALSE)
# Create interactive mapleaflet(data = museum_locations) %>% addTiles() %>% addCircleMarkers( ~long, ~lat, label = ~name, radius = 5, color = "purple", fillOpacity = 0.8 ) %>% addLegend("bottomright", colors = "purple", labels = "Museums", title = "Museums")