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
library(readr)
## Warning: package 'readr' was built under R version 4.0.5
nyc_plus_loc <- read_csv("nyc_plus_loc.csv")
## Rows: 168 Columns: 9
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): Restaurant
## dbl (8): Case, Price, Food, Decor, Service, East, latitude, longitude
##
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
datamap <- read.csv(file = "nyc_plus_loc.csv", header = TRUE, sep = ",")
Italian <- data.frame(Case = datamap$Case,
Restaurant = datamap$Restaurant,
Price = datamap$Price,
Food = datamap$Food,
Decor = datamap$Decor,
Service = datamap$Service,
East = datamap$East,
Latitude = datamap$latitude,
Longitude = datamap$longitude)
map <- Italian %>%
leaflet() %>%
addTiles() %>%
addMarkers(popup=paste
("<br>Restaurant: ",
htmlEscape(Italian$Restaurant),
"<br>Price for a meal for two (USD): ",
htmlEscape(Italian$Price),
"<br>Food (Scale from 1-30): ",
htmlEscape(Italian$Food),
"<br>Decor (Scale from 1-30): ",
htmlEscape(Italian$Decor),
"<br>Service (Scale from 1-30): ",
htmlEscape(Italian$Service)
)
)
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively
map