I wanted to plot the coordinates on a Google Map in the presence of point id:
Sample of data:
coordinates id
1 (7.1735, 45.868
One of the problems with plotting of your points is that if you use zoom=10 in function get_map() then your points are outside the map and they want be plotted, so I used zoom=5 instead.
library(ggmap)
map <- get_map(location = 'Switzerland', zoom = 5,
maptype = "terrain", source = "google")
For the plotting of map I used function ggmap(). To add points geom_point() can be used. For this purpose your sample data were saved as data frame df with columns x, y and id. To zoom closer to points coord_map() can be used.
p <- ggmap(map)
p <- p +geom_point(data=df,aes(x=x,y=y))+
coord_map(xlim=c(7,8),ylim=c(45.5,46))
print(p)
If you need to add labels to each point then add this line to map p
annotate("text",x=df$x,y=df$y,label=df$id)
