We will be plotting the 3 Michelin Star restaurants in New York City
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.5
library(htmltools)
## Warning: package 'htmltools' was built under R version 4.0.5
We took the data from Kagle, picking the 3 Michelin star restaurants from this dataset: https://www.kaggle.com/jackywang529/michelin-restaurants We will filter the data for New York City and create a map of the 3-Michelin Star restaurants in New York.
setwd("C:/Users/Valor/Desktop/Data Science/Developing Data Products")
fname = "three-stars-michelin-restaurants.csv"
restaurants <- read.csv(fname, row.names = 1)
restaurants <- subset(restaurants, restaurants$city == "New York")
map <- restaurants %>%
leaflet() %>%
addTiles() %>%
addMarkers(popup = paste(htmlEscape(rownames(restaurants))))
## Assuming "longitude" and "latitude" are longitude and latitude, respectively
map