0

I'm currently using ggmaps to display a map of the location I'm trying to display points over but when I use the points function to try to add the points over the map it says that my list of latitudes and longitudes cannot be used for the arguments in x and y. Is there any better way to plot the points other than having to go one by one and individually code them onto my map?

Edit: Here's the data I'm working with right now and the first few lines of code that aren't working- -A table of 2 variables "lat" and "lon" that show all the points geocoded -A list of the addresses where the geo coordinates came from

mapTampa <- get_map(location = 'Tampa', zoom = 10)
points(lon, lat, col = "red", cex = 0.5)

The first line works and gives me the map but when I tried to add points thats when it gave me the x y error so I tried:

finalMap<-mapTampa+geom_point(aes(x=lon, y=lat, data=Filtered_Data))

Where latlong is my table with both latitudes and longitudes but that doesn't work either. I'm fairly new to R and this is my first project working with it but it seems like I've read everything about ggplot and ggmap and nothing is helping me.

  • 4
    Could you show the first few rows of data, the code you've tried, and the error message? It would help understand the question better. – Sai SL Feb 17 '19 at 16:42
  • Please read https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example to learn how to construct better questions with all the required details – dww Feb 17 '19 at 16:56
  • Remove the data argument from within the aes() call – Henry Cyranka Feb 17 '19 at 18:03

0 Answers0