I'm al little confused on how to make my points show information when they are being hovered over. currently this code makes the value that I want to show come up automatically on the map, not when you hover over the points. Since there are 10,000+ data points, it shows a mess of values all over the place. I know plotly is a library to make this sort of thing happen but I tried a couple of small adjustments to the code with the library and it all failed. the code is pasted below as well as a link to an image of what the code produces. PLEASE HELP!
library(ggplot2)
library(ggmap)
library(maps)
library(mapdata)
library(geosphere)
library(zoom)
library(ggrepel)
library(plotly)
states <- map_data("state")
regionofInterest<- subset(states, region %in% c("california", "arizona", "new mexico", "texas", "oklahoma","kansas", "missouri", "arkansas", "louisiana", "illinois", "mississippi","indiana", "kentucky", "tennessee", "alabama", "ohio", "west virginia", "virginia", "north carolina", "south carolina", "georgia", "pennsylvania", "delaware", "maryland", "new jersey"))
ggplot(data = regionofInterest) +
geom_polygon(aes(x = long, y = lat, group = group), fill = "#efede1", color = "black") +
geom_curve(data=dataset, aes(x = dataset$LNG_BASE, y = dataset$LAT_BASE, xend = dataset$LNG, yend = dataset$LAT), col = "#b29e7d", size = 1, curvature = .2) +
geom_point(data=dataset, aes(x = dataset$LNG, y = dataset$LAT), col = "red") +
geom_text_repel(data=dataset, aes(x = dataset$LNG, y = dataset$LAT, label = round(dataset$DISTANCE)), col = "black", size = 2, segment.color = NA) +
theme(panel.background = element_rect(fill="white"),
axis.line = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank()
)