Given a CSV file with the the name of a state, the latitude and
longitude of its centroid, write an R program using the leaflet package
to produce a map with popups at each centroid showing the name of the
state.
Solution
library(leaflet)# Load data from CSV filestates <-read.csv("State Centroids.csv")# Create a leaflet mapleaflet(states) %>%addTiles() %>%addMarkers(lng = states$Longitude, lat = states$Latitude, popup = states$State)