Reputation: 1778
The following code works fine:
library(ggmap)
mp2 <- ggmap::get_map(location="South America", zoom = 4, source="google")
ggmap(mp2) +
geom_point(aes(c(-60), c(-1)), size=15) # plot one single point on map
generating this:
Though the following won't behave as expected for some reason:
ggmap(mp2) +
geom_point(aes(c(-60, -65, -62), c(-1, -5, -10)))
giving me the following error:
Error in data.frame(x = c(-60, -65, -62), y = c(-1, -5, -10), PANEL = c(1L, :
arguments imply differing number of rows: 3, 4
Upvotes: 0
Views: 1876
Reputation: 5856
this should work
df <- data.frame(lon=c(-60, -65, -62), lat = c(-1, -5, -10))
ggmap(mp2) +
geom_point(aes(x = lon, y = lat), size = 10, data = df)
Upvotes: 2